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 void
handleDigestResponse(Address sender, Digest digest)
void
handleExit()
void
handleJoinResponse(JoinRsp join_rsp)
void
handleLeaveResponse()
void
handleMembershipChange(java.util.Collection<GmsImpl.Request> requests)
void
handleMergeCancelled(ViewId merge_id)
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.void
handleMergeResponse(MergeData data, ViewId merge_id)
void
handleMergeView(MergeData data, ViewId merge_id)
If merge_id is not equal to this.merge_id then discard.void
handleViewChange(View new_view, Digest digest)
Called by the GMS when a VIEW is received.void
init()
void
join(Address mbr)
void
joinWithStateTransfer(Address mbr)
void
leave(Address mbr)
The coordinator itself wants to leave the groupvoid
merge(java.util.Vector<Address> other_coords)
Invoked upon receiving a MERGE event from the MERGE layer.void
stop()
void
suspect(Address mbr)
void
unsuspect(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:
joinWithStateTransfer
in classGmsImpl
-
leave
public void leave(Address mbr)
The coordinator itself wants to leave the group
-
handleJoinResponse
public void handleJoinResponse(JoinRsp join_rsp)
- Specified by:
handleJoinResponse
in classGmsImpl
-
handleLeaveResponse
public void handleLeaveResponse()
- Specified by:
handleLeaveResponse
in 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:
handleMergeRequest
in classGmsImpl
-
handleMergeResponse
public void handleMergeResponse(MergeData data, ViewId merge_id)
- Overrides:
handleMergeResponse
in classGmsImpl
-
handleDigestResponse
public void handleDigestResponse(Address sender, Digest digest)
- Overrides:
handleDigestResponse
in 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:
handleMergeView
in classGmsImpl
-
handleMergeCancelled
public void handleMergeCancelled(ViewId merge_id)
- Overrides:
handleMergeCancelled
in classGmsImpl
-
handleMembershipChange
public void handleMembershipChange(java.util.Collection<GmsImpl.Request> requests)
- Specified by:
handleMembershipChange
in classGmsImpl
-
handleViewChange
public void handleViewChange(View new_view, Digest digest)
Called by the GMS when a VIEW is received.- Specified by:
handleViewChange
in 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:
handleExit
in classGmsImpl
-
-