Search in sources :

Example 11 with BlocksMapUpdateInfo

use of org.apache.hadoop.hdfs.server.namenode.INode.BlocksMapUpdateInfo in project hadoop by apache.

the class FSNamesystem method renameTo.

void renameTo(final String src, final String dst, boolean logRetryCache, Options.Rename... options) throws IOException {
    final String operationName = "rename";
    FSDirRenameOp.RenameResult res = null;
    writeLock();
    try {
        checkOperation(OperationCategory.WRITE);
        checkNameNodeSafeMode("Cannot rename " + src);
        res = FSDirRenameOp.renameToInt(dir, src, dst, logRetryCache, options);
    } catch (AccessControlException e) {
        logAuditEvent(false, operationName + " (options=" + Arrays.toString(options) + ")", src, dst, null);
        throw e;
    } finally {
        writeUnlock(operationName);
    }
    getEditLog().logSync();
    BlocksMapUpdateInfo collectedBlocks = res.collectedBlocks;
    if (!collectedBlocks.getToDeleteList().isEmpty()) {
        removeBlocks(collectedBlocks);
        collectedBlocks.clear();
    }
    logAuditEvent(true, operationName + " (options=" + Arrays.toString(options) + ")", src, dst, res.auditStat);
}
Also used : BlocksMapUpdateInfo(org.apache.hadoop.hdfs.server.namenode.INode.BlocksMapUpdateInfo) AccessControlException(org.apache.hadoop.security.AccessControlException) SnapshotAccessControlException(org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException)

Aggregations

BlocksMapUpdateInfo (org.apache.hadoop.hdfs.server.namenode.INode.BlocksMapUpdateInfo)11 SnapshotAccessControlException (org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException)4 AccessControlException (org.apache.hadoop.security.AccessControlException)4 ChunkedArrayList (org.apache.hadoop.util.ChunkedArrayList)3 IOException (java.io.IOException)2 HdfsFileStatus (org.apache.hadoop.hdfs.protocol.HdfsFileStatus)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 HadoopIllegalArgumentException (org.apache.hadoop.HadoopIllegalArgumentException)1 FileEncryptionInfo (org.apache.hadoop.fs.FileEncryptionInfo)1 InvalidPathException (org.apache.hadoop.fs.InvalidPathException)1 Block (org.apache.hadoop.hdfs.protocol.Block)1 CacheDirectiveInfo (org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo)1 ErasureCodingPolicy (org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy)1 LastBlockWithStatus (org.apache.hadoop.hdfs.protocol.LastBlockWithStatus)1 LocatedBlock (org.apache.hadoop.hdfs.protocol.LocatedBlock)1 BlockInfo (org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo)1 RollingUpgradeStartupOption (org.apache.hadoop.hdfs.server.common.HdfsServerConstants.RollingUpgradeStartupOption)1 EncryptionKeyInfo (org.apache.hadoop.hdfs.server.namenode.FSDirEncryptionZoneOp.EncryptionKeyInfo)1 AddBlockOp (org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.AddBlockOp)1