@Test public void lockFinalEdgeWrite() throws Exception { mInodeStore.removeChild(mRootDir.getId(), "a"); mPath = create("/a", LockPattern.READ); mPath.traverse(); LockedInodePath writeLocked = mPath.lockFinalEdgeWrite(); assertFalse(writeLocked.fullPathExists()); assertEquals(Arrays.asList(mRootDir), writeLocked.getInodeList()); checkOnlyNodesReadLocked(mRootDir); checkOnlyNodesWriteLocked(); checkOnlyIncomingEdgesReadLocked(mRootDir); checkOnlyIncomingEdgesWriteLocked(mDirA); writeLocked.close(); checkOnlyNodesReadLocked(mRootDir); checkOnlyNodesWriteLocked(); checkOnlyIncomingEdgesReadLocked(mRootDir); checkOnlyIncomingEdgesWriteLocked(); }
public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE, mUseTryLock); newPath.traverse(); return newPath; }
LockedInodePath implements Closeable { public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE, mUseTryLock); newPath.traverse(); return newPath; } }
LockedInodePath implements Closeable { public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE, mUseTryLock); newPath.traverse(); return newPath; } LockedInodePath(AlluxioURI uri, ReadOnlyInodeStore inodeStore,
      InodeLockManager inodeLockManager, InodeDirectory root, LockPattern lockPattern,
      boolean tryLock); private  LockedInodePath(AlluxioURI uri, LockedInodePath path, String[] pathComponents,
      LockPattern lockPattern, boolean tryLock); }
LockedInodePath implements Closeable { public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE, mUseTryLock); newPath.traverse(); return newPath; } LockedInodePath(AlluxioURI uri, ReadOnlyInodeStore inodeStore,
      InodeLockManager inodeLockManager, InodeDirectory root, LockPattern lockPattern,
      boolean tryLock); private  LockedInodePath(AlluxioURI uri, LockedInodePath path, String[] pathComponents,
      LockPattern lockPattern, boolean tryLock); AlluxioURI getUri(); Inode getInode(); @Nullable Inode getInodeOrNull(); InodeFile getInodeFile(); InodeDirectory getParentInodeDirectory(); @Nullable Inode getParentInodeOrNull(); Inode getLastExistingInode(); List<Inode> getInodeList(); List<InodeView> getInodeViewList(); int getExistingInodeCount(); int size(); boolean fullPathExists(); LockPattern getLockPattern(); void removeLastInode(); void addNextInode(Inode inode); void downgradeToRead(); Inode getAncestorInode(); LockedInodePath lockDescendant(AlluxioURI descendantUri, LockPattern lockPattern); LockedInodePath lockChild(Inode child, LockPattern lockPattern); LockedInodePath lockChild(Inode child, LockPattern lockPattern,
      String[] childComponentsHint); LockedInodePath lockFinalEdgeWrite(); void traverse(); @Override void close(); @Override String toString(); }
LockedInodePath implements Closeable { public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE, mUseTryLock); newPath.traverse(); return newPath; } LockedInodePath(AlluxioURI uri, ReadOnlyInodeStore inodeStore,
      InodeLockManager inodeLockManager, InodeDirectory root, LockPattern lockPattern,
      boolean tryLock); private  LockedInodePath(AlluxioURI uri, LockedInodePath path, String[] pathComponents,
      LockPattern lockPattern, boolean tryLock); AlluxioURI getUri(); Inode getInode(); @Nullable Inode getInodeOrNull(); InodeFile getInodeFile(); InodeDirectory getParentInodeDirectory(); @Nullable Inode getParentInodeOrNull(); Inode getLastExistingInode(); List<Inode> getInodeList(); List<InodeView> getInodeViewList(); int getExistingInodeCount(); int size(); boolean fullPathExists(); LockPattern getLockPattern(); void removeLastInode(); void addNextInode(Inode inode); void downgradeToRead(); Inode getAncestorInode(); LockedInodePath lockDescendant(AlluxioURI descendantUri, LockPattern lockPattern); LockedInodePath lockChild(Inode child, LockPattern lockPattern); LockedInodePath lockChild(Inode child, LockPattern lockPattern,
      String[] childComponentsHint); LockedInodePath lockFinalEdgeWrite(); void traverse(); @Override void close(); @Override String toString();  }