er, sequencer-specific

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Your task is to create a sequencer-based multicasting service, using a slight variant of the simple version

of the Amoeba protocol (the first protocol described in www.cdk3.net/coordination), and a small client

application to exercise it. You will use Java RMI and multicast sockets.

The main classes in your implementation will be:

 TestSequencer.java – each instance (you will create several) will allow the user to enter

strings and multicast them to a group of instances of TestSequencer. TestSequencer will

also be capable of “stress-testing” – multicasting messages as fast as possible.

 Group.java – TestSequencer uses an instance of Group for group communication

services. Group in turn uses a MulticastSocket to receive incoming messages, and uses RMI

to the sequencer for sending messages and other, sequencer-specific operations

 Sequencer.java, SequencerImpl.java – the interface to and implementation of a sequencer.

 History.java – the implementation of the sequencer's history. History does not need to

have a fixed capacity, but obsolete items should be removed whenever its size grows beyond a

threshold, say 1024 entries.

Attached you will find (i) the RMI interface to an object which will implement the sequencer

(Sequencer.java), (ii) two trivial classes associated with the Sequencer definition

(SequencerJoinInfo.java and SequencerException.java), (iii) outline code for

Group.java, and (iv) some hints on marchalling messages into datagram packets.

You need to write SequencerImpl.java and History.java from scratch.

Note that the scheme you produce will not precisely implement the Amoeba protocol. In that protocol,

messages are sent unreliably to the sequencer in the first instance. In yours, messages to be multicast are

handed to the sequencer using RMI.

Choosing a multicast address and time-to-live

SequencerImpl should take as an argument the IP multicast address that the corresponding Groups are to

use. To avoid collisions with numbers chosen by others, incorporate a random number into the multicast

IP address that you use – e.g. 234.day.month.rand where rand is a random number between 1 and 254.

Don't set your sockets' time-to-live (TTL) to more than 1. That way, your multicast packets will not be

transmitted beyond the local router.

Hints: Marshalling data into a datagram

ByteArrayOutputStream bstream = new

ByteArrayOutputStream(MAX_MSG_LENGTH);

DataOutputStream dstream = new DataOutputStream(bstream);

dstream.writeLong(aLong); // marshals a Long into the byte array underlying bstream

// …

// After marshalling, the data can be obtained from bstream for inclusion in a DatagramPacket:

byte[] theData = bstream.toByteArray();

(For unmarshalling there are corresponding classes ByteArrayInputStream and DataInputStream.)

 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Storage Devices
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education