/** * Deletes a single inode from the inode tree by removing it from the parent inode. * * @param rpcContext the rpc context * @param inodePath the {@link LockedInodePath} to delete * @param opTimeMs the operation time * @throws FileDoesNotExistException if the Inode cannot be retrieved */ 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) .build()); if (inode.isFile()) { rpcContext.getBlockDeletionContext().registerBlocksForDeletion(inode.asFile().getBlockIds()); } }
.setAlluxioOnly(deleteOptions.isAlluxioOnly()) .setRecursive(deleteOptions.isRecursive()) .setOpTimeMs(opTimeMs).build(); rpcContext.journal(Journal.JournalEntry.newBuilder().setDeleteFile(deleteFile).build());
public Builder mergeFrom(alluxio.proto.journal.File.DeleteFileEntry other) { if (other == alluxio.proto.journal.File.DeleteFileEntry.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); } if (other.hasRecursive()) { setRecursive(other.getRecursive()); } if (other.hasOpTimeMs()) { setOpTimeMs(other.getOpTimeMs()); } if (other.hasAlluxioOnly()) { setAlluxioOnly(other.getAlluxioOnly()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(alluxio.proto.journal.File.DeleteFileEntry other) { if (other == alluxio.proto.journal.File.DeleteFileEntry.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); } if (other.hasRecursive()) { setRecursive(other.getRecursive()); } if (other.hasOpTimeMs()) { setOpTimeMs(other.getOpTimeMs()); } if (other.hasAlluxioOnly()) { setAlluxioOnly(other.getAlluxioOnly()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }