@Test public void deleteInode() throws Exception { createPath(mTree, NESTED_URI, sNestedDirectoryContext); try (LockedInodePath inodePath = mTree.lockFullInodePath(0, LockPattern.WRITE_INODE)) { assertEquals(2, mTree.getDescendants(inodePath).getInodePathList().size()); deleteInodeByPath(mTree, NESTED_URI); assertEquals(1, mTree.getDescendants(inodePath).getInodePathList().size()); } }
public void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs) throws FileDoesNotExistException { Preconditions.checkState(inodePath.getLockPattern() == LockPattern.WRITE_EDGE); Inode inode = inodePath.getInode(); mState.applyAndJournal(rpcContext, DeleteFileEntry.newBuilder() .setId(inode.getId()) .setRecursive(false) .setOpTimeMs(opTimeMs) .setPath(inodePath.getUri().getPath()) .build()); if (inode.isFile()) { rpcContext.getBlockDeletionContext().registerBlocksForDeletion(inode.asFile().getBlockIds()); } }
InodeTree implements DelegatingJournaled { public void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs) throws FileDoesNotExistException { Preconditions.checkState(inodePath.getLockPattern() == LockPattern.WRITE_EDGE); Inode inode = inodePath.getInode(); mState.applyAndJournal(rpcContext, DeleteFileEntry.newBuilder() .setId(inode.getId()) .setRecursive(false) .setOpTimeMs(opTimeMs) .setPath(inodePath.getUri().getPath()) .build()); if (inode.isFile()) { rpcContext.getBlockDeletionContext().registerBlocksForDeletion(inode.asFile().getBlockIds()); } } }
InodeTree implements DelegatingJournaled { public void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs) throws FileDoesNotExistException { Preconditions.checkState(inodePath.getLockPattern() == LockPattern.WRITE_EDGE); Inode inode = inodePath.getInode(); mState.applyAndJournal(rpcContext, DeleteFileEntry.newBuilder() .setId(inode.getId()) .setRecursive(false) .setOpTimeMs(opTimeMs) .setPath(inodePath.getUri().getPath()) .build()); if (inode.isFile()) { rpcContext.getBlockDeletionContext().registerBlocksForDeletion(inode.asFile().getBlockIds()); } } InodeTree(InodeStore inodeStore, ContainerIdGenerable containerIdGenerator,
      InodeDirectoryIdGenerator directoryIdGenerator, MountTable mountTable,
      InodeLockManager lockManager); }
InodeTree implements DelegatingJournaled { public void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs) throws FileDoesNotExistException { Preconditions.checkState(inodePath.getLockPattern() == LockPattern.WRITE_EDGE); Inode inode = inodePath.getInode(); mState.applyAndJournal(rpcContext, DeleteFileEntry.newBuilder() .setId(inode.getId()) .setRecursive(false) .setOpTimeMs(opTimeMs) .setPath(inodePath.getUri().getPath()) .build()); if (inode.isFile()) { rpcContext.getBlockDeletionContext().registerBlocksForDeletion(inode.asFile().getBlockIds()); } } InodeTree(InodeStore inodeStore, ContainerIdGenerable containerIdGenerator,
      InodeDirectoryIdGenerator directoryIdGenerator, MountTable mountTable,
      InodeLockManager lockManager); void initializeRoot(String owner, String group, Mode mode, JournalContext context); TtlBucketList getTtlBuckets(); long getInodeCount(); void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir); long newBlock(Supplier<JournalContext> context, NewBlockEntry entry); void updateInodeFile(Supplier<JournalContext> context, UpdateInodeFileEntry entry); void updateInode(Supplier<JournalContext> context, UpdateInodeEntry entry); UpdateInodeEntry updateInodeAccessTimeNoJournal(long inodeId, long accessTime); void rename(Supplier<JournalContext> context, RenameEntry entry); void setAcl(Supplier<JournalContext> context, SetAclEntry entry); @Nullable String getRootUserName(); int getPinnedSize(); boolean inodeIdExists(long id); LockedInodePath tryLockInodePath(LockingScheme scheme); LockedInodePath lockInodePath(LockingScheme scheme); LockedInodePath lockInodePath(AlluxioURI uri, LockPattern lockPattern); LockedInodePath lockInodePath(AlluxioURI uri, LockPattern lockPattern, boolean tryLock); boolean inodePathExists(AlluxioURI uri); LockedInodePath lockFullInodePath(AlluxioURI uri, LockingScheme lockScheme); LockedInodePath lockFullInodePath(AlluxioURI uri, LockPattern lockPattern); LockedInodePath lockFullInodePath(long id, LockPattern lockPattern); InodePathPair lockInodePathPair(AlluxioURI path1, LockPattern lockPattern1,
      AlluxioURI path2, LockPattern lockPattern2); void ensureFullInodePath(LockedInodePath inodePath); AlluxioURI getPath(InodeView inode); InodeDirectory getRoot(); List<Inode> createPath(RpcContext rpcContext, LockedInodePath inodePath,
      CreatePathContext<?, ?> context); LockedInodePathList getDescendants(LockedInodePath inodePath); void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs); void setPinned(RpcContext rpcContext, LockedInodePath inodePath, boolean pinned,
      List<String> mediumTypes, long opTimeMs); void setReplication(RpcContext rpcContext, LockedInodePath inodePath,
      Integer replicationMax, Integer replicationMin, long opTimeMs); Set<Long> getReplicationLimitedFileIds(); Set<Long> getToBePersistedIds(); Set<Long> getPinIdSet(); InodeLockManager getInodeLockManager(); boolean isRootId(long fileId); @Override Journaled getDelegate(); void syncPersistExistingDirectory(Supplier<JournalContext> context, InodeDirectoryView dir); void syncPersistNewDirectory(MutableInodeDirectory dir); void close(); }
InodeTree implements DelegatingJournaled { public void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs) throws FileDoesNotExistException { Preconditions.checkState(inodePath.getLockPattern() == LockPattern.WRITE_EDGE); Inode inode = inodePath.getInode(); mState.applyAndJournal(rpcContext, DeleteFileEntry.newBuilder() .setId(inode.getId()) .setRecursive(false) .setOpTimeMs(opTimeMs) .setPath(inodePath.getUri().getPath()) .build()); if (inode.isFile()) { rpcContext.getBlockDeletionContext().registerBlocksForDeletion(inode.asFile().getBlockIds()); } } InodeTree(InodeStore inodeStore, ContainerIdGenerable containerIdGenerator,
      InodeDirectoryIdGenerator directoryIdGenerator, MountTable mountTable,
      InodeLockManager lockManager); void initializeRoot(String owner, String group, Mode mode, JournalContext context); TtlBucketList getTtlBuckets(); long getInodeCount(); void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir); long newBlock(Supplier<JournalContext> context, NewBlockEntry entry); void updateInodeFile(Supplier<JournalContext> context, UpdateInodeFileEntry entry); void updateInode(Supplier<JournalContext> context, UpdateInodeEntry entry); UpdateInodeEntry updateInodeAccessTimeNoJournal(long inodeId, long accessTime); void rename(Supplier<JournalContext> context, RenameEntry entry); void setAcl(Supplier<JournalContext> context, SetAclEntry entry); @Nullable String getRootUserName(); int getPinnedSize(); boolean inodeIdExists(long id); LockedInodePath tryLockInodePath(LockingScheme scheme); LockedInodePath lockInodePath(LockingScheme scheme); LockedInodePath lockInodePath(AlluxioURI uri, LockPattern lockPattern); LockedInodePath lockInodePath(AlluxioURI uri, LockPattern lockPattern, boolean tryLock); boolean inodePathExists(AlluxioURI uri); LockedInodePath lockFullInodePath(AlluxioURI uri, LockingScheme lockScheme); LockedInodePath lockFullInodePath(AlluxioURI uri, LockPattern lockPattern); LockedInodePath lockFullInodePath(long id, LockPattern lockPattern); InodePathPair lockInodePathPair(AlluxioURI path1, LockPattern lockPattern1,
      AlluxioURI path2, LockPattern lockPattern2); void ensureFullInodePath(LockedInodePath inodePath); AlluxioURI getPath(InodeView inode); InodeDirectory getRoot(); List<Inode> createPath(RpcContext rpcContext, LockedInodePath inodePath,
      CreatePathContext<?, ?> context); LockedInodePathList getDescendants(LockedInodePath inodePath); void deleteInode(RpcContext rpcContext, LockedInodePath inodePath, long opTimeMs); void setPinned(RpcContext rpcContext, LockedInodePath inodePath, boolean pinned,
      List<String> mediumTypes, long opTimeMs); void setReplication(RpcContext rpcContext, LockedInodePath inodePath,
      Integer replicationMax, Integer replicationMin, long opTimeMs); Set<Long> getReplicationLimitedFileIds(); Set<Long> getToBePersistedIds(); Set<Long> getPinIdSet(); InodeLockManager getInodeLockManager(); boolean isRootId(long fileId); @Override Journaled getDelegate(); void syncPersistExistingDirectory(Supplier<JournalContext> context, InodeDirectoryView dir); void syncPersistNewDirectory(MutableInodeDirectory dir); void close(); static final long NO_PARENT; static final String ROOT_INODE_NAME; static final String ROOT_PATH; static final int PATH_TRAVERSAL_RETRIES; }