org.jgroups.protocols
Class TOTAL
public
class
TOTAL
extends Protocol
Implements the total ordering layer using a message sequencer
The protocol guarantees that all bcast sent messages will be delivered in
the same order to all members. For that it uses a sequencer which assignes
monotonically increasing sequence ID to broadcasts. Then all group members
deliver the bcasts in ascending sequence ID order.
-
When a bcast message comes down to this layer, it is placed in the pending
down queue. A bcast request is sent to the sequencer.
-
When the sequencer receives a bcast request, it creates a bcast reply
message and assigns to it a monotonically increasing seqID and sends it back
to the source of the bcast request.
-
When a broadcast reply is received, the corresponding bcast message is
assigned the received seqID. Then it is broadcasted.
-
Received bcasts are placed in the up queue. The queue is sorted according
to the seqID of the bcast. Any message at the head of the up queue with a
seqID equal to the next expected seqID is delivered to the layer above.
-
Unicast messages coming from the layer below are forwarded above.
-
Unicast messages coming from the layer above are forwarded below.
Please note that once a BLOCK_OK
is acknowledged messages
coming from above are discarded! Either the application must stop
sending messages when a
BLOCK
event is received from the
channel or a QUEUE layer should be placed above this one. Received messages
are still delivered above though.
bcast requests are retransmitted periodically until a bcast reply is
received. In case a BCAST_REP is on its way during a BCAST_REQ
retransmission, then the next BCAST_REP will be to a non-existing
BCAST_REQ. So, a nulll BCAST message is sent to fill the created gap in
the seqID of all members.
Author: i.georgiadis@doc.ic.ac.uk
public TOTAL()
Create the TOTAL layer
public void down(
Event event)
public String getName()
public Vector requiredDownServices()
public Vector requiredUpServices()
public boolean setProperties(Properties properties)
public void start()
Prepare this layer to receive messages from above
public void stop()
Handle the stop() method travelling down the stack.
The local addr is set to null, since after a Start->Stop->Start
sequence this member's addr is not guaranteed to be the same
public void up(
Event event)
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.