Package org.jgroups.protocols.pbcast
Class CoordGmsImpl
- java.lang.Object
-
- org.jgroups.protocols.pbcast.GmsImpl
-
- org.jgroups.protocols.pbcast.CoordGmsImpl
-
public class CoordGmsImpl extends GmsImpl
Coordinator role of the Group MemberShip (GMS) protocol. Accepts JOIN and LEAVE requests and emits view changes accordingly.- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.pbcast.GmsImpl
GmsImpl.Request
-
-
Constructor Summary
Constructors Constructor Description CoordGmsImpl(GMS g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleDigestResponse(Address sender, Digest digest)voidhandleExit()voidhandleJoinResponse(JoinRsp join_rsp)voidhandleLeaveResponse()voidhandleMembershipChange(java.util.Collection<GmsImpl.Request> requests)voidhandleMergeCancelled(ViewId merge_id)voidhandleMergeRequest(Address sender, ViewId merge_id)Get the view and digest and send back both (MergeData) in the form of a MERGE_RSP to the sender.voidhandleMergeResponse(MergeData data, ViewId merge_id)voidhandleMergeView(MergeData data, ViewId merge_id)If merge_id is not equal to this.merge_id then discard.voidhandleViewChange(View new_view, Digest digest)Called by the GMS when a VIEW is received.voidinit()voidjoin(Address mbr)voidjoinWithStateTransfer(Address mbr)voidleave(Address mbr)The coordinator itself wants to leave the groupvoidmerge(java.util.Vector<Address> other_coords)Invoked upon receiving a MERGE event from the MERGE layer.voidstop()voidsuspect(Address mbr)voidunsuspect(Address mbr)-
Methods inherited from class org.jgroups.protocols.pbcast.GmsImpl
handleUpEvent, iWouldBeCoordinator, sendMergeRejectedResponse, start, wrongMethod
-
-
-
-
Constructor Detail
-
CoordGmsImpl
public CoordGmsImpl(GMS g)
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
-
joinWithStateTransfer
public void joinWithStateTransfer(Address mbr)
- Specified by:
joinWithStateTransferin classGmsImpl
-
leave
public void leave(Address mbr)
The coordinator itself wants to leave the group
-
handleJoinResponse
public void handleJoinResponse(JoinRsp join_rsp)
- Specified by:
handleJoinResponsein classGmsImpl
-
handleLeaveResponse
public void handleLeaveResponse()
- Specified by:
handleLeaveResponsein classGmsImpl
-
merge
public void merge(java.util.Vector<Address> other_coords)
Invoked upon receiving a MERGE event from the MERGE layer. Starts the merge protocol. See description of protocol in DESIGN.
-
handleMergeRequest
public void handleMergeRequest(Address sender, ViewId merge_id)
Get the view and digest and send back both (MergeData) in the form of a MERGE_RSP to the sender. If a merge is already in progress, send back a MergeData with the merge_rejected field set to true.- Overrides:
handleMergeRequestin classGmsImpl
-
handleMergeResponse
public void handleMergeResponse(MergeData data, ViewId merge_id)
- Overrides:
handleMergeResponsein classGmsImpl
-
handleDigestResponse
public void handleDigestResponse(Address sender, Digest digest)
- Overrides:
handleDigestResponsein classGmsImpl
-
handleMergeView
public void handleMergeView(MergeData data, ViewId merge_id)
If merge_id is not equal to this.merge_id then discard. Else cast the view/digest to all members of this group.- Overrides:
handleMergeViewin classGmsImpl
-
handleMergeCancelled
public void handleMergeCancelled(ViewId merge_id)
- Overrides:
handleMergeCancelledin classGmsImpl
-
handleMembershipChange
public void handleMembershipChange(java.util.Collection<GmsImpl.Request> requests)
- Specified by:
handleMembershipChangein classGmsImpl
-
handleViewChange
public void handleViewChange(View new_view, Digest digest)
Called by the GMS when a VIEW is received.- Specified by:
handleViewChangein classGmsImpl- Parameters:
new_view- The view to be installeddigest- If view is a MergeView, digest contains the seqno digest of all members and has to be set by GMS
-
handleExit
public void handleExit()
- Overrides:
handleExitin classGmsImpl
-
-