Class Leaver


  • public class Leaver
    extends java.lang.Object
    Handles the leaving of a member from a group. On leave(), a LEAVE-REQ is sent to the coordinator and the caller is blocked until a LEAVE-RSP has been received.
    If the coordinator changes before the response has been received, the LEAVE-REQ will be resent to the new cordinator. If the coordinator is null, leave() returns.
    Since:
    4.1.4
    Author:
    Bela Ban
    • Constructor Summary

      Constructors 
      Constructor Description
      Leaver​(GMS gms)  
    • Field Detail

      • gms

        protected final GMS gms
      • log

        protected final Log log
      • leaving

        protected final java.util.concurrent.atomic.AtomicBoolean leaving
    • Constructor Detail

      • Leaver

        public Leaver​(GMS gms)
    • Method Detail

      • leave

        public void leave()
        Sends a LEAVE-REQ to the coordinator. Blocks the caller until a LEAVE-RSP has been received, or no coord is found.
      • handleLeaveResponse

        public void handleLeaveResponse​(Address sender)
      • coordChanged

        public void coordChanged​(Address new_coord)
        Callback to notify Leaver that the coord changed. This will result in resending the LEAVE-REQ to the new coordinator. If there's no new coord (e.g. because we're the last member), leave() (if there is one in progress) will return and unblock the caller.
      • reset

        public void reset()
        Interrupts and stops the current leave process (if one is in progress). No-op is no leave process is in progress. This unblocks the caller of leave() (if present).
      • sendLeaveRequest

        protected void sendLeaveRequest​(Address coord,
                                        Address leaving_mbr)