boolean isLockedBy(Object lockBy) {
    lock.lock();
    try {
      return owner == lockBy;
    } finally {
      lock.unlock();
    }
  }
Check whether the lock is locked by the given {@code lockBy}.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateNodeLock.java