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);
}
Aggregations