in hbase-oss/src/main/java/org/apache/hadoop/hbase/oss/sync/TreeLockManager.java [367:379]
public AutoLock lockWrite(Path rawPath) throws IOException {
Path path = norm(rawPath);
LOG.debug("About to lock for create / write: {}", rawPath);
// Depth should not matter here, as this is only called on files, not
// directories.
treeWriteLock(path, Depth.RECURSIVE);
return new AutoLock() {
public void close() throws IOException {
LOG.debug("About to unlock after create / write: {}", path);
writeUnlock(path);
}
};
}