dlmarion commented on code in PR #6199:
URL: https://github.com/apache/accumulo/pull/6199#discussion_r2907352396


##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ServiceLock.java:
##########
@@ -100,38 +119,70 @@ public interface AccumuloLockWatcher extends LockWatcher {
     void failedToAcquireLock(Exception e);
   }
 
+  // the base path
   private final ServiceLockPath path;
+
   protected final ZooKeeper zooKeeper;
+
+  // "zlock#" + UUID + "#"
   private final Prefix vmLockPrefix;
 
+  // A LockWatcher instance supplied to this class
+  // by the caller when trying to acquire the lock
+  // in ZooKeeper. This object does not represent
+  // a Watcher in ZooKeeper, but allows an instance
+  // of this class to communicate with the calling
+  // object by invoking callback methods.
   private LockWatcher lockWatcher;
-  private String lockNodeName;
+
+  // A variable which is initially null, then set
+  // to the createdNodeName when the lock is acquired.
+  // This variable is set to null when this instance
+  // loses the lock.
+  private volatile String lockNodeName;
+
+  // boolean to track if this instance has ever held the lock
   private volatile boolean lockWasAcquired;
-  private volatile boolean watchingParent;
 
-  private String createdNodeName;
+  // boolean to track if there is a watcher on the base path.
+  private volatile boolean watchingBasePath;
+
+  // Represents the name of the ephemeral sequential node that
+  // the ZooKeeper server created for us with the unique one-up
+  // counter. This variable is set to null when this instance
+  // acquires the lock.
+  private volatile String createdNodeName;
+
+  // Represents the name of the ephemeral sequential node that
+  // has the next lowest counter value. An instance of this class
+  // will watch this node and will attempt to acquire the lock
+  // when this node is deleted.
   private String watchingNodeName;

Review Comment:
   Fixed variable name in 2a591cc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to