Class CENTRAL_LOCK2

All Implemented Interfaces:
Lifecycle

@Deprecated public class CENTRAL_LOCK2 extends Locking
Deprecated.
See http://belaban.blogspot.com/2020/11/i-hate-distributed-locks.html.
Implementation of a locking protocol which acquires locks by asking the coordinator.

Because the coordinator maintains all locks, no total ordering of requests is required.

CENTRAL_LOCK2 has all members send lock and unlock requests to the current coordinator. The coordinator has a queue for incoming requests, and grants locks based on order of arrival.

Contrary to CENTRAL_LOCK, CENTRAL_LOCK2 has no members who act as backups for lock information. Instead, when the coord leaves or on a merge, the new coordinator runs a reconciliation protocol in which it fetches information from all members about acquired locks and pending lock and unlock requests, and then creates its lock table accordingly. During this phase, all regular request handling is paused.

This protocol requires less traffic than CENTRAL_LOCK (each request also has to be sent to the backup(s)), but introduces communication between the new coord and all members (and thus a small pause) on coord change.

The JIRA issue is https://issues.redhat.com/browse/JGRP-2249.

Since:
4.0.13
See Also:
  • Field Details

  • Constructor Details

    • CENTRAL_LOCK2

      public CENTRAL_LOCK2()
      Deprecated.
  • Method Details

    • isCoord

      public boolean isCoord()
      Deprecated.
    • getCoordinator

      public String getCoordinator()
      Deprecated.
    • isRequestHandlerRunning

      public boolean isRequestHandlerRunning()
      Deprecated.
    • requestQueueSize

      public int requestQueueSize()
      Deprecated.
    • stop

      public void stop()
      Deprecated.
      Description copied from class: Protocol
      Called on a JChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom.
      Specified by:
      stop in interface Lifecycle
      Overrides:
      stop in class Protocol
    • handleView

      public void handleView(View v)
      Deprecated.
      Overrides:
      handleView in class Locking
    • requestReceived

      protected void requestReceived(Locking.Request req)
      Deprecated.
      Overrides:
      requestReceived in class Locking
    • processQueue

      protected void processQueue()
      Deprecated.
    • handleLockInfoRequest

      protected void handleLockInfoRequest(Address requester)
      Deprecated.
      Overrides:
      handleLockInfoRequest in class Locking
    • handleLockInfoResponse

      protected void handleLockInfoResponse(Address sender, Locking.Request rsp)
      Deprecated.
      Overrides:
      handleLockInfoResponse in class Locking
    • handleLockRevoked

      protected void handleLockRevoked(Locking.Request rsp)
      Deprecated.
      Overrides:
      handleLockRevoked in class Locking
    • runReconciliation

      public void runReconciliation()
      Deprecated.
      Grabs information about locks held and pending lock/unlock requests from all members
    • sendLockInfoRequestTo

      protected void sendLockInfoRequestTo(Locking.Request req, Address[] mbrs, Address exclude)
      Deprecated.
    • getOwner

      protected Owner getOwner()
      Deprecated.
      Overrides:
      getOwner in class Locking
    • sendGrantLockRequest

      protected void sendGrantLockRequest(String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock)
      Deprecated.
      Specified by:
      sendGrantLockRequest in class Locking
    • sendReleaseLockRequest

      protected void sendReleaseLockRequest(String lock_name, int lock_id, Owner owner)
      Deprecated.
      Specified by:
      sendReleaseLockRequest in class Locking
    • sendAwaitConditionRequest

      protected void sendAwaitConditionRequest(String lock_name, Owner owner)
      Deprecated.
      Specified by:
      sendAwaitConditionRequest in class Locking
    • sendSignalConditionRequest

      protected void sendSignalConditionRequest(String lock_name, boolean all)
      Deprecated.
      Specified by:
      sendSignalConditionRequest in class Locking
    • sendDeleteAwaitConditionRequest

      protected void sendDeleteAwaitConditionRequest(String lock_name, Owner owner)
      Deprecated.
      Specified by:
      sendDeleteAwaitConditionRequest in class Locking
    • createLockInfoResponse

      protected Locking.LockInfoResponse createLockInfoResponse()
      Deprecated.