hbase-oss/src/main/java/org/apache/hadoop/hbase/oss/sync/ZKTreeLockManager.java
private boolean isLocked(InterProcessMutex lock) throws IOException {
    try {
      if (lock.isOwnedByCurrentThread()) {
        // First check the current thread, because we allow you to get locks
        // when parent or child paths are only locked by you.
        return false;
      }
      if (lock.isAcquiredInThisProcess()) {
        // We know it's not this thread, but this is less expensive
        // than checking other processes.
        return true;
      }
      return !lock.getParticipantNodes().isEmpty();
    } catch (KeeperException.NoNodeException e){
      return false;
    } catch (Exception e) {
      logCaller();
      throw new IOException("Exception while testing a lock", e);
    }
  }
/**
   * Specifically, if this is lock by another thread.
   */
Specifically, if this is lock by another thread.
Specifically if this is lock by another thread .
private boolean isLocked(InterProcessMutex lock) throws IOException {
    try {
      if (lock.isOwnedByCurrentThread()) {
        return false;
      }
      if (lock.isAcquiredInThisProcess()) {
        return true;
      }
      return !lock.getParticipantNodes().isEmpty();
    } catch (KeeperException.NoNodeException e){
      return false;
    } catch (Exception e) {
      logCaller();
      throw new IOException("Exception while testing a lock", e);
    }
  }
private boolean isLocked ( InterProcessMutex lock ) throws IOException { try { if ( lock . isOwnedByCurrentThread ( ) ) { return false ; } if ( lock . isAcquiredInThisProcess ( ) ) { return true ; } return ! lock . getParticipantNodes ( ) . isEmpty ( ) ; } catch ( KeeperException . NoNodeException e ) { return false ; } catch ( Exception e ) { logCaller ( ) ; throw new IOException ( "Exception while testing a lock" , e ) ; } }
Specifically, if this is lock by another thread.
Specifically if this is lock by another thread .
// First check the current thread, because we allow you to get locks // when parent or child paths are only locked by you. // We know it's not this thread, but this is less expensive // than checking other processes.