Class Leaver

java.lang.Object
org.jgroups.protocols.pbcast.Leaver

public class Leaver extends 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
  • Field Details

    • gms

      protected final GMS gms
    • log

      protected final Log log
    • leave_promise

      protected final Promise<Address> leave_promise
    • leaving

      protected final AtomicBoolean leaving
  • Constructor Details

    • Leaver

      public Leaver(GMS gms)
  • Method Details

    • 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)