|
|||||||||||
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.GMS
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.
Field Summary | |
java.lang.String |
group_addr
|
java.lang.Object |
impl_mutex
|
long |
join_retry_timeout
|
long |
join_timeout
|
long |
leave_timeout
|
Address |
local_addr
|
long |
ltime
|
Membership |
mbrs
|
static java.lang.String |
name
|
ViewId |
view_id
|
java.lang.Object |
view_mutex
|
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, log, observer, props, stack, stats, trace, up_handler, up_prot, up_queue, up_thread, up_thread_prio, warn |
Constructor Summary | |
GMS()
|
Method Summary | |
void |
becomeClient()
|
void |
becomeCoordinator()
|
void |
becomeParticipant()
|
void |
castViewChange(java.util.Vector new_mbrs,
java.util.Vector old_mbrs,
java.util.Vector suspected_mbrs)
Compute a new view, given the current view, the new members and the suspected/left members. |
protected boolean |
checkSelfInclusion(java.util.Vector mbrs)
Returns true if local_addr is member of mbrs, else false |
protected Address |
determineCoordinator()
|
void |
flush(java.util.Vector flush_dest,
java.util.Vector suspected_mbrs)
FLUSH protocol. |
java.lang.String |
getName()
|
View |
getNextView(java.util.Vector new_mbrs,
java.util.Vector old_mbrs,
java.util.Vector suspected_mbrs)
Computes the next view. |
boolean |
handleDownEvent(Event evt)
Callback. |
boolean |
handleJoin(Address mbr)
|
void |
handleLeave(Address mbr,
boolean suspected)
|
View |
handleMerge(ViewId other_vid,
java.util.Vector other_members)
|
void |
handleSuspect(Address mbr)
|
boolean |
handleUpEvent(Event evt)
Callback. |
void |
handleViewChange(ViewId new_view,
java.util.Vector mbrs)
|
void |
installView(ViewId new_view,
java.util.Vector mbrs)
Assigns the new ltime. |
void |
join(Address mbr)
|
void |
leave(Address mbr)
|
View |
makeView(java.util.Vector mbrs)
|
static View |
makeView(java.util.Vector mbrs,
ViewId vid)
|
void |
merge(java.util.Vector other_coords)
|
void |
receiveDownEvent(Event evt)
Internal method, should not be called by clients. |
java.util.Vector |
requiredDownServices()
List of events that are required to be answered by some layer below. |
void |
run()
|
void |
setImpl(GmsImpl new_impl)
|
boolean |
setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string |
void |
start()
This method is called on a Channel.connect(String) . |
void |
suspect(Address mbr)
|
Methods inherited from class org.jgroups.stack.RpcProtocol |
callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, handle |
Methods inherited from class org.jgroups.stack.MessageProtocol |
castMessage, down, sendMessage, stop, up, updateView |
Methods inherited from class org.jgroups.stack.Protocol |
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, isTrace, isWarn, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveUpEvent, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setTrace, setUpProtocol, setWarn, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public Address local_addr
public java.lang.String group_addr
public final Membership mbrs
public ViewId view_id
public long ltime
public long join_timeout
public long join_retry_timeout
public long leave_timeout
public final java.lang.Object impl_mutex
public final java.lang.Object view_mutex
public static final java.lang.String name
Constructor Detail |
public GMS()
Method Detail |
public java.lang.String getName()
getName
in class RpcProtocol
public java.util.Vector requiredDownServices()
Protocol
requiredDownServices
in class Protocol
public void setImpl(GmsImpl new_impl)
public void start() throws java.lang.Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.
start
in class MessageProtocol
java.lang.Exception
public void becomeCoordinator()
public void becomeParticipant()
public void becomeClient()
public View getNextView(java.util.Vector new_mbrs, java.util.Vector old_mbrs, java.util.Vector suspected_mbrs)
old_mbrs
and
suspected_mbrs
removed and new_mbrs
added.
public void flush(java.util.Vector flush_dest, java.util.Vector suspected_mbrs)
public void castViewChange(java.util.Vector new_mbrs, java.util.Vector old_mbrs, java.util.Vector suspected_mbrs)
existing leaving suspected joining 1. FLUSH y y n n 2. new_view y n n y 3. tmp_view y y n y (view_dest)
public void installView(ViewId new_view, java.util.Vector mbrs)
protected Address determineCoordinator()
protected boolean checkSelfInclusion(java.util.Vector mbrs)
public View makeView(java.util.Vector mbrs)
public static View makeView(java.util.Vector mbrs, ViewId vid)
public void join(Address mbr)
public void leave(Address mbr)
public void suspect(Address mbr)
public void merge(java.util.Vector other_coords)
public boolean handleJoin(Address mbr)
public void handleLeave(Address mbr, boolean suspected)
public void handleViewChange(ViewId new_view, java.util.Vector mbrs)
public View handleMerge(ViewId other_vid, java.util.Vector other_members)
public void handleSuspect(Address mbr)
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
public void receiveDownEvent(Event evt)
Protocol
receiveDownEvent
in class Protocol
public boolean setProperties(java.util.Properties props)
setProperties
in class Protocol
public void run()
run
in interface java.lang.Runnable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |