public class GMS extends RpcProtocol implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
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 |
_corr, membersdown_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio| Constructor and Description |
|---|
GMS() |
| Modifier and Type | Method and Description |
|---|---|
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) |
callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, handlecastMessage, down, sendMessage, stop, up, updateViewdestroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveUpEvent, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabledpublic 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
public java.lang.String getName()
getName in class RpcProtocolpublic java.util.Vector requiredDownServices()
ProtocolrequiredDownServices in class Protocolpublic void setImpl(GmsImpl new_impl)
public void start()
throws java.lang.Exception
ProtocolChannel.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 MessageProtocoljava.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String) will throw an exceptionpublic 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 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 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 RpcProtocolpublic 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 RpcProtocolpublic void receiveDownEvent(Event evt)
ProtocolreceiveDownEvent in class Protocolpublic boolean setProperties(java.util.Properties props)
setProperties in class Protocolpublic void run()
run in interface java.lang.RunnableCopyright ? 1998-2006 Bela Ban. All Rights Reserved.