| |
|
| java.lang.Object java.lang.Thread org.jgroups.stack.UpHandler org.jgroups.protocols.TOTAL
TOTAL | public class TOTAL extends Protocol (Code) | | 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 null BCAST message is sent to fill the created gap in
the seqID of all members.
author: i.georgiadis@doc.ic.ac.uk author: Bela Ban |
Constructor Summary | |
public | TOTAL() |
TOTAL | public TOTAL()(Code) | | Create the TOTAL layer
|
down | public void down(Event event)(Code) | | Process an event coming from the layer above
Parameters: event - the event to process |
requiredDownServices | public Vector requiredDownServices()(Code) | | Events that some layer below must handle
the set of Event s that must be handled by some layerbelow |
requiredUpServices | public Vector requiredUpServices()(Code) | | Events that some layer above must handle
the set of Event s that must be handled by somelayer above |
setProperties | public boolean setProperties(Properties properties)(Code) | | Configure the protocol based on the given list of properties
Parameters: properties - the list of properties to use to setup this layer false if there was any unrecognized property or a property withan invalid value |
start | public void start() throws Exception(Code) | | Prepare this layer to receive messages from above
|
stop | public void stop()(Code) | | 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
|
up | public void up(Event event)(Code) | | Process an event coming from the layer below
Parameters: event - the event to process |
Fields inherited from org.jgroups.stack.UpHandler | final protected Log log(Code)(Java Doc)
|
|
|
|