| java.lang.Object java.lang.Thread org.jgroups.stack.UpHandler org.jgroups.protocols.pbcast.STABLE
STABLE | public class STABLE extends Protocol (Code) | | 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. This allows NAKACK to garbage collect messages that
have been seen by all members.
Works as follows: periodically we mcast our highest seqnos (seen for each member) to the group.
A stability vector, which maintains the highest seqno for each member and initially contains no data,
is updated when such a message is received. The entry for a member P is computed set to
min(entry[P], digest[P]). When messages from all members have been received, a stability
message is mcast, which causes all members to send a STABLE event up the stack (triggering garbage collection
in the NAKACK layer).
The stable task now terminates after max_num_gossips if no messages or view changes have been sent or received
in the meantime. It will resume when messages are received. This effectively suspends sending superfluous
STABLE messages in the face of no activity.
New: when max_bytes is exceeded (unless disabled by setting it to 0),
a STABLE task will be started (unless it is already running).
author: Bela Ban |
Inner Class :public static class StableHeader extends Header implements Streamable | |
desired_avg_gossip | long desired_avg_gossip(Code) | | Sends a STABLE gossip every 20 seconds on average. 0 disables gossipping of STABLE messages
|
initialized | boolean initialized(Code) | | |
max_bytes | long max_bytes(Code) | | Total amount of bytes from incoming messages (default = 0 = disabled). When exceeded, a STABLE
message will be broadcast and num_bytes_received reset to 0 . If this is > 0, then ideally
stability_delay should be set to a low number as well
|
num_bytes_received | long num_bytes_received(Code) | | The total number of bytes received from unicast and multicast messages
|
num_gossips | int num_gossips(Code) | | Number of gossip messages
|
stability_delay | long stability_delay(Code) | | delay before we send STABILITY msg (give others a change to send first). This should be set to a very
small number (> 0 !) if max_bytes is used
|
suspended | boolean suspended(Code) | | When true, don't take part in garbage collection protocol: neither send STABLE messages nor
handle STABILITY messages
|
getDesiredAverageGossip | public long getDesiredAverageGossip()(Code) | | |
getMaxBytes | public long getMaxBytes()(Code) | | |
getNumberOfGossipMessages | public int getNumberOfGossipMessages()(Code) | | |
requiredDownServices | public Vector requiredDownServices()(Code) | | |
resetStats | public void resetStats()(Code) | | |
runMessageGarbageCollection | public void runMessageGarbageCollection()(Code) | | |
sendStabilityMessage | void sendStabilityMessage(Digest tmp)(Code) | | Schedules a stability message to be mcast after a random number of milliseconds (range 1-5 secs).
The reason for waiting a random amount of time is that, in the worst case, all members receive a
STABLE_GOSSIP message from the last outstanding member at the same time and would therefore mcast the
STABILITY message at the same time too. To avoid this, each member waits random N msecs. If, before N
elapses, some other member sent the STABILITY message, we just cancel our own message. If, during
waiting for N msecs to send STABILITY message S1, another STABILITY message S2 is to be sent, we just
discard S2.
Parameters: tmp - A copy of te stability digest, so we don't need to copy it again |
setDesiredAverageGossip | public void setDesiredAverageGossip(long gossip_interval)(Code) | | |
setMaxBytes | public void setMaxBytes(long max_bytes)(Code) | | |
startResumeTask | void startResumeTask(long max_suspend_time)(Code) | | |
startStabilityTask | void startStabilityTask(Digest d, long delay)(Code) | | |
startStableTask | void startStableTask()(Code) | | |
stopResumeTask | void stopResumeTask()(Code) | | |
stopStabilityTask | void stopStabilityTask()(Code) | | |
stopStableTask | void stopStableTask()(Code) | | |
Fields inherited from org.jgroups.stack.UpHandler | final protected Log log(Code)(Java Doc)
|
|
|