org.jgroups.protocols
Class TOTAL
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.
- i.georgiadis@doc.ic.ac.uk
static class | TOTAL.Header - The header processed by the TOTAL layer and intended for TOTAL
inter-stack communication
|
down_handler , down_prot , down_queue , down_thread , down_thread_prio , log , observer , props , stack , stats , trace , up_handler , up_prot , up_queue , up_thread , up_thread_prio , warn |
TOTAL() - Create the TOTAL layer
|
void | down(Event event) - An event is to be sent down the stack.
|
String | getName()
|
Vector | requiredDownServices() - List of events that are required to be answered by some layer below.
|
Vector | requiredUpServices() - List of events that are required to be answered by some layer above.
|
boolean | setProperties(Properties properties) - Configures the protocol initially.
|
void | start() - Prepare this layer to receive messages from above
|
void | stop() - Handle the stop() method travelling down the stack.
|
void | up(Event event) - An event was received from the layer below.
|
destroy , down , downThreadEnabled , dumpStats , enableStats , getDownProtocol , getDownQueue , getName , getProperties , getUpProtocol , getUpQueue , handleSpecialDownEvent , init , isTrace , isWarn , passDown , passUp , printStats , providedDownServices , providedUpServices , receiveDownEvent , receiveUpEvent , requiredDownServices , requiredUpServices , resetStats , setDownProtocol , setObserver , setProperties , setPropertiesInternal , setProtocolStack , setTrace , setUpProtocol , setWarn , start , startDownHandler , startUpHandler , statsEnabled , stop , stopInternal , up , upThreadEnabled |
TOTAL
public TOTAL()
Create the TOTAL layer
down
public void down(Event event)
An event is to be sent down the stack. The layer may want to examine its type and perform
some action on it, depending on the event's type. If the event is a message MSG, then
the layer may need to add a header to it (or do nothing at all) before sending it down
the stack using passDown()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using passUp()
.
- down in interface Protocol
requiredDownServices
public Vector requiredDownServices()
List of events that are required to be answered by some layer below.
- requiredDownServices in interface Protocol
requiredUpServices
public Vector requiredUpServices()
List of events that are required to be answered by some layer above.
- requiredUpServices in interface Protocol
setProperties
public boolean setProperties(Properties properties)
Configures the protocol initially. A configuration string consists of name=value
items, separated by a ';' (semicolon), e.g.:
"loopback=false;unicast_inport=4444"
- setProperties in interface Protocol
start
public void start()
throws Exception
Prepare this layer to receive messages from above
- start in interface Protocol
stop
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
- stop in interface Protocol
up
public void up(Event event)
An event was received from the layer below. Usually the current layer will want to examine
the event type and - depending on its type - perform some computation
(e.g. removing headers from a MSG event type, or updating the internal membership list
when receiving a VIEW_CHANGE event).
Finally the event is either a) discarded, or b) an event is sent down
the stack using passDown()
or c) the event (or another event) is sent up
the stack using passUp()
.
- up in interface Protocol
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.