java.lang.Object
org.jgroups.protocols.GmsImpl
org.jgroups.protocols.ClientGmsImpl
- public class ClientGmsImpl
- extends GmsImpl
Client part of GMS. Whenever a new member wants to join a group, it starts in the CLIENT role.
No multicasts to the group will be received and processed until the member has been joined and
turned into a SERVER (either coordinator or participant, mostly just participant). This class
only implements Join (called by clients who want to join a certain group, and
ViewChange which is called by the coordinator that was contacted by this client, to
tell the client what its initial membership is.
- Version:
- $Revision: 1.11 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
initial_mbrs
final java.util.Vector initial_mbrs
view_installation_mutex
final java.lang.Object view_installation_mutex
joined
boolean joined
ClientGmsImpl
public ClientGmsImpl(GMS g)
init
public void init()
- Specified by:
init in class GmsImpl
join
public void join(org.jgroups.Address mbr)
- Will generate a CONNECT_OK event. Determines the coordinator and sends a unicast
join() message to it. If successful, we wait for a ViewChange (can time out).
If view change is received, impl is changed to an instance of ParticipantGmsImpl.
Otherwise, we continue trying to send join() messages to the coordinator,
until we succeed (or there is no member in the group. In this case, we create
our own singleton group).
When GMS.disable_initial_coord is set to true, then we won't become coordinator on receiving an initial
membership of 0, but instead will retry (forever) until we get an initial membership of > 0.
- Specified by:
join in class GmsImpl
leave
public void leave(org.jgroups.Address mbr)
- Specified by:
leave in class GmsImpl
suspect
public void suspect(org.jgroups.Address mbr)
- Specified by:
suspect in class GmsImpl
merge
public void merge(java.util.Vector other_coords)
- Specified by:
merge in class GmsImpl
handleJoin
public boolean handleJoin(org.jgroups.Address mbr)
- Specified by:
handleJoin in class GmsImpl
handleLeave
public void handleLeave(org.jgroups.Address mbr,
boolean suspected)
- Returns false. Clients don't handle leave() requests
- Specified by:
handleLeave in class GmsImpl
handleViewChange
public void handleViewChange(org.jgroups.ViewId new_view,
java.util.Vector mems)
- Install the first view in which we are a member. This is essentially a confirmation
of our JOIN request (see join() above).
- Specified by:
handleViewChange in class GmsImpl
handleMerge
public org.jgroups.View handleMerge(org.jgroups.ViewId other_view,
java.util.Vector other_members)
- Returns immediately. Clients don't handle merge() requests
- Specified by:
handleMerge in class GmsImpl
handleSuspect
public void handleSuspect(org.jgroups.Address mbr)
- Returns immediately. Clients don't handle suspect() requests
- Specified by:
handleSuspect in class GmsImpl
handleUpEvent
public boolean handleUpEvent(org.jgroups.Event evt)
- Overrides:
handleUpEvent in class GmsImpl
findInitialMembers
void findInitialMembers()
- Pings initial members. Removes self before returning vector of initial members.
Uses IP multicast or gossiping, depending on parameters.
determineCoord
org.jgroups.Address determineCoord(java.util.Vector mbrs)
- The coordinator is determined by a majority vote. If there are an equal number of votes for
more than 1 candidate, we determine the winner randomly.