private boolean writeLockBelow()

in hbase-oss/src/main/java/org/apache/hadoop/hbase/oss/sync/ZKTreeLockManager.java [285:308]


  private boolean writeLockBelow(Path p, int level, int maxLevel) throws IOException {
    try {
      if (level > 0 && isLocked(get(p).writeLock())) {
        return true;
      }
      if (level < maxLevel) {
        List<String> children = curator.getChildren().forPath(p.toString());
        for (String child : children) {
          if (child.equals(LOCK_SUB_ZNODE)) {
            continue;
          }
          if (writeLockBelow(new Path(p, child), level+1, maxLevel)) {
            LOG.debug("Parent write lock currently held: {}", p);
            return true;
          }
        }
      }
    } catch (KeeperException.NoNodeException e) {
      // Ignore, means we hit the bottom of the tree
    } catch (Exception e) {
      throw new IOException("Error checking parents for write lock: " + p, e);
    }
    return false;
  }