All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.JavaStack.Protocols.GMS

java.lang.Object
   |
   +----JavaGroups.JavaStack.Protocol
           |
           +----JavaGroups.JavaStack.MessageProtocol
                   |
                   +----JavaGroups.JavaStack.RpcProtocol
                           |
                           +----JavaGroups.JavaStack.Protocols.GMS

public class GMS
extends RpcProtocol
implements Runnable
Group membership protocol. Handles joins/leaves/crashes (suspicions) and emits new views accordingly. Use VIEW_ENFORCER on top of this layer to make sure new members don't receive any messages until they are members.


Variable Index

 o group_addr
 o impl_mutex
 o initial_mbrs_timeout
 o join_retry_timeout
 o join_timeout
 o leave_timeout
 o local_addr
 o ltime
 o members
 o props
 o trace
 o view_id
 o view_mutex

Constructor Index

 o GMS()

Method Index

 o CastViewChange(Vector, Vector, Vector)
Compute a new view, given the current view, the new members and the suspected/left members.
 o GetName()
 o GetNextView(Vector, Vector, Vector)
Computes the next view.
 o HandleDownEvent(Event)
Callback.
 o HandleJoin(Address)
 o HandleLeave(Address, boolean)
 o HandleMerge(Vector, Vector, long)
 o HandleSuspect(Address)
 o HandleUpEvent(Event)
Callback.
 o HandleViewChange(ViewId, Vector)
 o InstallView(ViewId, Vector)
Assigns the new ltime.
 o Join(Address)
 o Leave(Address)
 o MakeView(Vector)
 o MakeView(Vector, ViewId)
 o Merge(Vector)
 o ReceiveDownEvent(Event)
Internal method, should not be called by clients.
 o RequiredDownServices()
List of events that are required to be answered by some layer below.
 o run()
 o SetImpl(GmsImpl)
 o SetProperties(Properties)
Setup the Protocol instance acording to the configuration string
 o Suspect(Address)

Variables

 o props
 public Properties props
 o local_addr
 public Address local_addr
 o group_addr
 public String group_addr
 o members
 public Membership members
 o view_id
 public ViewId view_id
 o ltime
 public long ltime
 o initial_mbrs_timeout
 public long initial_mbrs_timeout
 o join_timeout
 public long join_timeout
 o join_retry_timeout
 public long join_retry_timeout
 o leave_timeout
 public long leave_timeout
 o trace
 public boolean trace
 o impl_mutex
 public Object impl_mutex
 o view_mutex
 public Object view_mutex

Constructors

 o GMS
 public GMS()

Methods

 o GetName
 public String GetName()
Overrides:
GetName in class RpcProtocol
 o RequiredDownServices
 public Vector RequiredDownServices()
List of events that are required to be answered by some layer below.

Overrides:
RequiredDownServices in class Protocol
 o SetImpl
 public void SetImpl(GmsImpl new_impl)
 o GetNextView
 public View GetNextView(Vector new_mbrs,
                         Vector old_mbrs,
                         Vector suspected_mbrs)
Computes the next view. Returns a copy that has old_mbrs and suspected_mbrs removed and new_mbrs added.

 o CastViewChange
 public void CastViewChange(Vector new_mbrs,
                            Vector old_mbrs,
                            Vector suspected_mbrs)
Compute a new view, given the current view, the new members and the suspected/left members. Run view update protocol to install a new view in all members (this involves casting the new view to all members). The targets for FLUSH and VIEW mcasts are computed as follows:

G is the current membership, N is the set of new members, L is the set of leaving members, S is the set of suspected members. The FLUSH mcast is sent to G minus S (including L). The VIEW mcast is sent to G plus N minus S (all existing members, plus the new member, excluding suspected members).

 o InstallView
 public void InstallView(ViewId new_view,
                         Vector mbrs)
Assigns the new ltime. Installs view and view_id. Changes role to coordinator if necessary. Sends VIEW_CHANGE event up and down the stack.

 o MakeView
 public View MakeView(Vector mbrs)
 o MakeView
 public View MakeView(Vector mbrs,
                      ViewId vid)
 o Join
 public void Join(Address mbr)
 o Leave
 public void Leave(Address mbr)
 o Suspect
 public void Suspect(Address mbr)
 o Merge
 public void Merge(Vector new_mbrs)
 o HandleJoin
 public boolean HandleJoin(Address mbr)
 o HandleLeave
 public void HandleLeave(Address mbr,
                         boolean suspected)
 o HandleViewChange
 public void HandleViewChange(ViewId new_view,
                              Vector mbrs)
 o HandleMerge
 public void HandleMerge(Vector new_mbrs,
                         Vector suspects,
                         long other_ltime)
 o HandleSuspect
 public void HandleSuspect(Address mbr)
 o HandleUpEvent
 public boolean HandleUpEvent(Event evt)
Callback. Called by superclass when event may be handled.

Do not use PassUp in this method as the event is passed up by default by the superclass after this method returns !

Returns:
boolean Defaults to true. If false, event will not be passed up the stack.
Overrides:
HandleUpEvent in class RpcProtocol
 o HandleDownEvent
 public boolean HandleDownEvent(Event evt)
Callback. Called by superclass when event may be handled.

Do not use PassDown in this method as the event is passed down by default by the superclass after this method returns !

Returns:
boolean Defaults to true. If false, event will not be passed down the stack.
Overrides:
HandleDownEvent in class RpcProtocol
 o ReceiveDownEvent
 public void ReceiveDownEvent(Event evt)
Internal method, should not be called by clients.

Overrides:
ReceiveDownEvent in class Protocol
 o SetProperties
 public boolean SetProperties(Properties props)
Setup the Protocol instance acording to the configuration string

Overrides:
SetProperties in class Protocol
 o run
 public void run()

All Packages  Class Hierarchy  This Package  Previous  Next  Index