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
    Author:
    Bela Ban
    See Also:
    Locking, CENTRAL_LOCK
    • Field Detail

      • lock_reconciliation_timeout

        protected long lock_reconciliation_timeout
        Deprecated.
      • coord

        protected Address coord
        Deprecated.
      • req_queue

        protected final java.util.concurrent.BlockingQueue<Locking.Request> req_queue
        Deprecated.
      • req_handler

        protected final Runner req_handler
        Deprecated.
    • Constructor Detail

      • CENTRAL_LOCK2

        public CENTRAL_LOCK2()
        Deprecated.
    • Method Detail

      • isCoord

        public boolean isCoord()
        Deprecated.
      • getCoordinator

        public java.lang.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
      • processQueue

        protected void processQueue()
        Deprecated.
      • runReconciliation

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

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

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

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

        protected void sendSignalConditionRequest​(java.lang.String lock_name,
                                                  boolean all)
        Deprecated.
        Specified by:
        sendSignalConditionRequest in class Locking