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
    • Constructor Detail

      • CoordGmsImpl

        public CoordGmsImpl​(GMS g)
    • Method Detail

      • init

        public void init()
                  throws java.lang.Exception
        Overrides:
        init in class GmsImpl
        Throws:
        java.lang.Exception
      • leave

        public void leave​(Address mbr)
        The coordinator itself wants to leave the group
        Specified by:
        leave in class GmsImpl
      • 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.
        Overrides:
        merge in class GmsImpl
        Parameters:
        other_coords - A list of coordinators (including myself) found by MERGE protocol
      • 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 class GmsImpl
      • 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 class GmsImpl
      • handleViewChange

        public void handleViewChange​(View new_view,
                                     Digest digest)
        Called by the GMS when a VIEW is received.
        Specified by:
        handleViewChange in class 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
      • stop

        public void stop()
        Overrides:
        stop in class GmsImpl