|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.stack.Protocol
org.jgroups.stack.MessageProtocol
org.jgroups.stack.RpcProtocol
org.jgroups.protocols.STABLE
Computes the broadcast messages that are stable, i.e. have been received
by all members. Sends STABLE events up the stack when this is the case.
Uses a probabilistic scheme to do so, as described in:
GSGC: An Efficient Gossip-Style Garbage Collection Scheme for Scalable
Reliable Multicast, K. Guo et al., 1997.
The only difference is that instead of using counters for an estimation of messages received from each member, we retrieve this actual information from the NAKACK layer (which must be present for the STABLE protocol to work).
Note: the the Event.MSG call path path must be as lightweight as possible. It should not request any lock for which there is a high contention and/or long delay.
Changes(igeorg - 2.VI.2001): i. Thread-safety (in RPC calls most notably on the lines of Gianluca Collot's bugfix) ii. All slow calls (RPCs, seqnos requests, etc.) placed outside locks iii. Removed redundant initialization in adaptation to a higher round iv. heard_from[this meber] is always set to true on every new round (i.e. on every stability bcast). v. Replaced gossip thread with TimeScheduler.Task
[[[ TODO(igeorg - 2.VI.2001) i. Faster stability convergence by better selection of gossip subsets (replace Util.pickSubset()). ii. Special mutex on the Event.MSG call path. I.e. remove synchronized(this)> with e.g. synchronized(msg_mutex). ]] TODO
Field Summary |
Fields inherited from class org.jgroups.stack.MessageProtocol |
_corr, members |
Fields inherited from class org.jgroups.stack.Protocol |
down_handler, down_prot, down_queue, down_thread, down_thread_prio, observer, props, stack, up_handler, up_prot, up_queue, up_thread, up_thread_prio |
Constructor Summary | |
STABLE()
|
Method Summary | |
java.lang.String |
getName()
|
void |
gossip(ViewId view_id,
long gossip_round,
long[] gossip_seqnos,
boolean[] heard,
java.lang.Object sender)
Contains the highest sequence numbers as seen by sender |
boolean |
handleDownEvent(Event evt)
Callback. |
boolean |
handleUpEvent(Event evt)
Callback. |
java.util.Vector |
requiredUpServices()
The events expected to be handled from some layer above: GET_MSGS_RECEIVED: NAKACK layer |
boolean |
setProperties(java.util.Properties props)
Set the parameters for this layer. |
void |
stability(ViewId view_id,
long gossip_round,
long[] stability_vector,
java.lang.Object sender)
Contains the highest message sequence numbers (for each member) that can safely be deleted (because they have been seen by all members). |
void |
start()
Start the layer: i. |
void |
stop()
Stop scheduling the gossip task |
Methods inherited from class org.jgroups.stack.RpcProtocol |
callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, handle |
Methods inherited from class org.jgroups.stack.MessageProtocol |
castMessage, down, sendMessage, up, updateView |
Methods inherited from class org.jgroups.stack.Protocol |
destroy, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, init, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, stopInternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public STABLE()
Method Detail |
public java.lang.String getName()
getName
in class RpcProtocol
public java.util.Vector requiredUpServices()
requiredUpServices
in class Protocol
public boolean setProperties(java.util.Properties props)
setProperties
in class Protocol
props
- the list of parameterspublic void start() throws java.lang.Exception
start
in class MessageProtocol
java.lang.Exception
public void stop()
stop
in class MessageProtocol
public void gossip(ViewId view_id, long gossip_round, long[] gossip_seqnos, boolean[] heard, java.lang.Object sender)
sender
view_id
- The view ID in which the gossip was sent. Must be the
same as ours, otherwise it is discardedgossip_round
- The round in which the gossip was sentgossip_seqnos
- A vector with the highest sequence numbers as
seen by sender
heard
- The sender's heard_from
array. This allows
us to minimize the gossip msgs for a given round as a member does not
have to receive gossip msgs from each member, but members pass gossips
they've received from others on in their own gossips. E.g. when a
member P (of group {P,Q,R}) receives a gossip from R, its own gossip
to Q might be {R,P}. Q, who hasn't received a gossip from R, will not
need to receive it anymore as it is already sent by P. This simple
scheme reduces the number of gossip messages needed.sender
- The sender of the gossip message (obviously :-))public void stability(ViewId view_id, long gossip_round, long[] stability_vector, java.lang.Object sender)
public boolean handleUpEvent(Event evt)
Do not use PassUp
in this method as the event is passed
up by default by the superclass after this method returns !
handleUpEvent
in class RpcProtocol
public boolean handleDownEvent(Event evt)
Do not use PassDown
in this method as the event is
passed down by default by the superclass after this method returns !
handleDownEvent
in class RpcProtocol
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |