org.jgroups.protocols.pbcast

Class 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

Field Summary

Fields inherited from class org.jgroups.protocols.pbcast.GmsImpl

gms, log

Constructor Summary

CoordGmsImpl(GMS g)

Method Summary

JoinRsp
handleJoin(Address mbr)
Computes the new view (including the newly joined member) and get the digest from PBCAST.
void
handleJoinResponse(JoinRsp join_rsp)
void
handleLeave(Address mbr, boolean suspected)
Exclude mbr from the membership.
void
handleLeaveResponse()
void
handleMergeCancelled(Object merge_id)
void
handleMergeRequest(Address sender, Object 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, Object merge_id)
void
handleMergeView(MergeData data, Object merge_id)
If merge_id != this.merge_id --> discard Else cast the view/digest to all members of this group.
void
handleSuspect(Address mbr)
void
handleViewChange(View new_view, Digest digest)
Called by the GMS when a VIEW is received.
void
join(Address mbr)
void
leave(Address mbr)
The coordinator itself wants to leave the group
void
merge(Vector 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

handleDownEvent, handleJoin, handleJoinResponse, handleLeave, handleLeaveResponse, handleMergeCancelled, handleMergeRequest, handleMergeResponse, handleMergeView, handleSuspect, handleUpEvent, handleViewChange, iWouldBeCoordinator, init, join, leave, merge, start, stop, suspect, unsuspect, wrongMethod

Constructor Details

CoordGmsImpl

public CoordGmsImpl(GMS g)

Method Details

handleJoin

public JoinRsp handleJoin(Address mbr)
Computes the new view (including the newly joined member) and get the digest from PBCAST. Returns both in the form of a JoinRsp
Overrides:
handleJoin in interface GmsImpl


handleJoinResponse

public void handleJoinResponse(JoinRsp join_rsp)
Overrides:
handleJoinResponse in interface GmsImpl


handleLeave

public void handleLeave(Address mbr,
                        boolean suspected)
Exclude mbr from the membership. If suspected is true, then this member crashed and therefore is forced to leave, otherwise it is leaving voluntarily.
Overrides:
handleLeave in interface GmsImpl


handleLeaveResponse

public void handleLeaveResponse()
Overrides:
handleLeaveResponse in interface GmsImpl


handleMergeCancelled

public void handleMergeCancelled(Object merge_id)
Overrides:
handleMergeCancelled in interface GmsImpl


handleMergeRequest

public void handleMergeRequest(Address sender,
                               Object 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 interface GmsImpl


handleMergeResponse

public void handleMergeResponse(MergeData data,
                                Object merge_id)
Overrides:
handleMergeResponse in interface GmsImpl


handleMergeView

public void handleMergeView(MergeData data,
                            Object merge_id)
If merge_id != this.merge_id --> discard Else cast the view/digest to all members of this group.
Overrides:
handleMergeView in interface GmsImpl


handleSuspect

public void handleSuspect(Address mbr)
Overrides:
handleSuspect in interface GmsImpl


handleViewChange

public void handleViewChange(View new_view,
                             Digest digest)
Called by the GMS when a VIEW is received.
Overrides:
handleViewChange in interface GmsImpl

Parameters:
new_view - The view to be installed
digest - If view is a MergeView, digest contains the seqno digest of all members and has to be set by GMS


join

public void join(Address mbr)
Overrides:
join in interface GmsImpl


leave

public void leave(Address mbr)
The coordinator itself wants to leave the group
Overrides:
leave in interface GmsImpl


merge

public void merge(Vector other_coords)
Invoked upon receiving a MERGE event from the MERGE layer. Starts the merge protocol. See description of protocol in DESIGN.
Overrides:
merge in interface GmsImpl

Parameters:
other_coords - A list of coordinators (including myself) found by MERGE protocol


stop

public void stop()
Overrides:
stop in interface GmsImpl


suspect

public void suspect(Address mbr)
Overrides:
suspect in interface GmsImpl


unsuspect

public void unsuspect(Address mbr)
Overrides:
unsuspect in interface GmsImpl


Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.