org.jgroups.protocols.pbcast

Class STABLE


public class STABLE
extends Protocol

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

Nested Class Summary

static class
STABLE.StableHeader

Field Summary

Fields inherited from class org.jgroups.stack.Protocol

down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, up_handler, up_prot, up_queue, up_thread, up_thread_prio

Method Summary

void
down(Event evt)
String
getName()
protected void
receiveUpEvent(Event evt)
We need to receive this event out-of-band, otherwise we would block.
Vector
requiredDownServices()
boolean
setProperties(Properties props)
void
start()
void
stop()
void
up(Event evt)

Methods inherited from class org.jgroups.stack.Protocol

destroy, down, getDownProtocol, getDownQueue, getName, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setProperties, setPropertiesInternal, setProtocolStack, setUpProtocol, start, startDownHandler, startUpHandler, stop, stopInternal, up

Method Details

down

public void down(Event evt)
Overrides:
down in interface Protocol

getName

public String getName()
Overrides:
getName in interface Protocol

receiveUpEvent

protected void receiveUpEvent(Event evt)
We need to receive this event out-of-band, otherwise we would block. The use case is
  1. To send a STABLE_GOSSIP message we need the digest (from NAKACK below)
  2. We send a GET_DIGEST_STABLE event down from the up() method
  3. NAKACK sends the GET_DIGEST_STABLE_OK backup. However, we may have other messages in the up queue ahead of this event ! Therefore the event cannot be processed until all messages ahead of the event have been processed. These can't be processed, however, because the up() call waits for GET_DIGEST_STABLE_OK ! The up() call would always run into the timeout. Having out-of-band reception of just this one event eliminates the problem.
Overrides:
receiveUpEvent in interface Protocol
Parameters:
evt -

requiredDownServices

public Vector requiredDownServices()
Overrides:
requiredDownServices in interface Protocol

setProperties

public boolean setProperties(Properties props)
Overrides:
setProperties in interface Protocol

start

public void start()
            throws Exception
Overrides:
start in interface Protocol

stop

public void stop()
Overrides:
stop in interface Protocol

up

public void up(Event evt)
Overrides:
up in interface Protocol

Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.