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.
-
group_addr
-
-
impl_mutex
-
-
initial_mbrs_timeout
-
-
join_retry_timeout
-
-
join_timeout
-
-
leave_timeout
-
-
local_addr
-
-
ltime
-
-
members
-
-
props
-
-
trace
-
-
view_id
-
-
view_mutex
-
-
GMS()
-
-
CastViewChange(Vector, Vector, Vector)
- Compute a new view, given the current view, the new members and the suspected/left
members.
-
GetName()
-
-
GetNextView(Vector, Vector, Vector)
- Computes the next view.
-
HandleDownEvent(Event)
- Callback.
-
HandleJoin(Address)
-
-
HandleLeave(Address, boolean)
-
-
HandleMerge(Vector, Vector, long)
-
-
HandleSuspect(Address)
-
-
HandleUpEvent(Event)
- Callback.
-
HandleViewChange(ViewId, Vector)
-
-
InstallView(ViewId, Vector)
- Assigns the new ltime.
-
Join(Address)
-
-
Leave(Address)
-
-
MakeView(Vector)
-
-
MakeView(Vector, ViewId)
-
-
Merge(Vector)
-
-
ReceiveDownEvent(Event)
- Internal method, should not be called by clients.
-
RequiredDownServices()
- List of events that are required to be answered by some layer below.
-
run()
-
-
SetImpl(GmsImpl)
-
-
SetProperties(Properties)
- Setup the Protocol instance acording to the configuration string
-
Suspect(Address)
-
props
public Properties props
local_addr
public Address local_addr
group_addr
public String group_addr
members
public Membership members
view_id
public ViewId view_id
ltime
public long ltime
initial_mbrs_timeout
public long initial_mbrs_timeout
join_timeout
public long join_timeout
join_retry_timeout
public long join_retry_timeout
leave_timeout
public long leave_timeout
trace
public boolean trace
impl_mutex
public Object impl_mutex
view_mutex
public Object view_mutex
GMS
public GMS()
GetName
public String GetName()
- Overrides:
- GetName in class RpcProtocol
RequiredDownServices
public Vector RequiredDownServices()
- List of events that are required to be answered by some layer below.
- Overrides:
- RequiredDownServices in class Protocol
SetImpl
public void SetImpl(GmsImpl new_impl)
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.
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).
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.
MakeView
public View MakeView(Vector mbrs)
MakeView
public View MakeView(Vector mbrs,
ViewId vid)
Join
public void Join(Address mbr)
Leave
public void Leave(Address mbr)
Suspect
public void Suspect(Address mbr)
Merge
public void Merge(Vector new_mbrs)
HandleJoin
public boolean HandleJoin(Address mbr)
HandleLeave
public void HandleLeave(Address mbr,
boolean suspected)
HandleViewChange
public void HandleViewChange(ViewId new_view,
Vector mbrs)
HandleMerge
public void HandleMerge(Vector new_mbrs,
Vector suspects,
long other_ltime)
HandleSuspect
public void HandleSuspect(Address mbr)
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
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
ReceiveDownEvent
public void ReceiveDownEvent(Event evt)
- Internal method, should not be called by clients.
- Overrides:
- ReceiveDownEvent in class Protocol
SetProperties
public boolean SetProperties(Properties props)
- Setup the Protocol instance acording to the configuration string
- Overrides:
- SetProperties in class Protocol
run
public void run()
All Packages Class Hierarchy This Package Previous Next Index