HDFS-8805. Archival Storage: getStoragePolicy should not need superuser privilege. Contributed by Brahma Reddy Battula.
This commit is contained in:
parent
fa1d84ae27
commit
1fc3c779a4
|
@ -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
|
||||
|
|
|
@ -135,7 +135,7 @@ final class FSDirAppendOp {
|
|||
}
|
||||
|
||||
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"
|
||||
|
|
|
@ -105,13 +105,11 @@ class FSDirStatAndListingOp {
|
|||
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 @@ class FSDirStatAndListingOp {
|
|||
}
|
||||
|
||||
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 @@ class FSDirStatAndListingOp {
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -432,7 +432,7 @@ class FSDirWriteFileOp {
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue