GeorryHuang commented on code in PR #5559:
URL: https://github.com/apache/hbase/pull/5559#discussion_r1432815568


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateNodeLock.java:
##########
@@ -40,30 +50,40 @@ class RegionStateNodeLock {
 
   private final Lock lock = new ReentrantLock();
 
-  private final Condition cond = lock.newCondition();
+  private final Queue<QueueEntry> waitingQueue = new ArrayDeque<>();
 
   private Object owner;
 
   private int count;
 
+  private interface QueueEntry {
+
+    Object getOwner();
+
+    void await() throws ProcedureSuspendedException;
+
+    void signal();

Review Comment:
   nit: same as above



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateNode.java:
##########
@@ -342,8 +343,8 @@ public void unlock() {
   // Notice that, this does not mean you must use these 3 methods when locking 
region state node in
   // procedure, you are free to use the above 3 methods if you do not want to 
hold the lock when
   // suspending the procedure.
-  public void lock(Procedure<?> proc) {
-    lock.lock(proc);
+  public void lock(Procedure<?> proc, Runnable wakeUp) throws 
ProcedureSuspendedException {

Review Comment:
   Nit: Could add docs here to describe `wakeup`? I was puzzled when I first 
read it, though I eventually understood your purpose.



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