HDFS-8805. Archival Storage: getStoragePolicy should not need superuser privilege. Contributed by Brahma Reddy Battula.

This commit is contained in:
Jing Zhao 2015-08-11 10:28:18 -07:00
parent fa1d84ae27
commit 1fc3c779a4
4 changed files with 8 additions and 8 deletions

View File

@ -775,6 +775,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8818. Changes the global moveExecutor to per datanode executors and
changes MAX_SIZE_TO_MOVE to be configurable. (szetszwo)
HDFS-8805. Archival Storage: getStoragePolicy should not need superuser privilege.
(Brahma Reddy Battula via jing9)
OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

View File

@ -135,7 +135,7 @@ static LastBlockWithStatus appendFile(final FSNamesystem fsn,
}
HdfsFileStatus stat = FSDirStatAndListingOp.getFileInfo(fsd, src, false,
FSDirectory.isReservedRawName(srcArg), true);
FSDirectory.isReservedRawName(srcArg));
if (lb != null) {
NameNode.stateChangeLog.debug(
"DIR* NameSystem.appendFile: file {} for {} at {} block {} block"

View File

@ -105,13 +105,11 @@ static HdfsFileStatus getFileInfo(
byte[][] pathComponents = FSDirectory.getPathComponentsForReservedPath(src);
src = fsd.resolvePath(pc, src, pathComponents);
final INodesInPath iip = fsd.getINodesInPath(src, resolveLink);
boolean isSuperUser = true;
if (fsd.isPermissionEnabled()) {
fsd.checkPermission(pc, iip, false, null, null, null, null, false);
isSuperUser = pc.isSuperUser();
}
return getFileInfo(fsd, src, resolveLink,
FSDirectory.isReservedRawName(srcArg), isSuperUser);
FSDirectory.isReservedRawName(srcArg));
}
/**
@ -369,8 +367,7 @@ static HdfsFileStatus getFileInfo(
}
static HdfsFileStatus getFileInfo(
FSDirectory fsd, String src, boolean resolveLink, boolean isRawPath,
boolean includeStoragePolicy)
FSDirectory fsd, String src, boolean resolveLink, boolean isRawPath)
throws IOException {
String srcs = FSDirectory.normalizePath(src);
if (srcs.endsWith(HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR)) {
@ -385,7 +382,7 @@ static HdfsFileStatus getFileInfo(
fsd.readLock();
try {
final INodesInPath iip = fsd.getINodesInPath(srcs, resolveLink);
return getFileInfo(fsd, src, iip, isRawPath, includeStoragePolicy);
return getFileInfo(fsd, src, iip, isRawPath, true);
} finally {
fsd.readUnlock();
}

View File

@ -432,7 +432,7 @@ static HdfsFileStatus startFile(
NameNode.stateChangeLog.debug("DIR* NameSystem.startFile: added " +
src + " inode " + newNode.getId() + " " + holder);
}
return FSDirStatAndListingOp.getFileInfo(fsd, src, false, isRawPath, true);
return FSDirStatAndListingOp.getFileInfo(fsd, src, false, isRawPath);
}
static EncryptionKeyInfo getEncryptionKeyInfo(FSNamesystem fsn,