Class ClientGmsImpl
java.lang.Object
org.jgroups.protocols.pbcast.GmsImpl
org.jgroups.protocols.pbcast.ClientGmsImpl
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.- Author:
- Bela Ban
-
Nested Class Summary
Nested classes/interfaces inherited from class GmsImpl
GmsImpl.Request -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanfirstOfAllClients(Address joiner, Responses rsps) Handles the case where no coord responses were received.voidhandleJoinResponse(JoinRsp join_rsp) voidinit()protected booleaninstallViewIfValidJoinRsp(Promise<JoinRsp> join_promise, boolean block_for_rsp) protected booleanvoidprotected voidjoinInternal(Address mbr, boolean joinWithStateTransfer) Makes this process join a group.voidjoinWithStateTransfer(Address local_addr) voidleave()Methods inherited from class GmsImpl
handleCoordLeave, handleDigestResponse, handleLeaveResponse, handleMembershipChange, handleMergeCancelled, handleMergeRequest, handleMergeResponse, handleMergeView, handleViewChange, merge, sendMergeRejectedResponse, start, stop, suspect, unsuspect, wrongMethod
-
Field Details
-
join_promise
-
-
Constructor Details
-
ClientGmsImpl
-
-
Method Details
-
init
-
join
-
joinWithStateTransfer
- Specified by:
joinWithStateTransferin classGmsImpl
-
joinInternal
Makes this process join a group. Determines the coordinator and sends a JOIN request to it. The coordinator returns a JOIN response, then broadcasts the new view, which contains a message digest and the current membership (including the joiner). The joiner then installs the new view and the digest and starts accepting messages.
If successful, impl is changed to an instance of ParticipantGmsImpl. Otherwise, we continue trying to send JOIN requests to the coordinator, until we succeed (or there is no member in the group. In this case, we create our own singleton group).- Parameters:
mbr- Our own address
-
leave
-
handleJoinResponse
- Overrides:
handleJoinResponsein classGmsImpl
-
installViewIfValidJoinRsp
-
firstOfAllClients
-
isJoinResponseValid
-