shvachko commented on a change in pull request #3205:
URL: https://github.com/apache/hadoop/pull/3205#discussion_r674367980
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirMkdirOp.java
##########
@@ -69,25 +69,34 @@ static FileStatus mkdirs(FSNamesystem fsn,
FSPermissionChecker pc, String src,
// create multiple inodes.
fsn.checkFsObjectLimit();
- // create all missing directories along the path,
- // but don't add them to the INodeMap yet
- permissions = addImplicitUwx(permissions, permissions); // SHV !!!
- INode[] missing = createPathDirectories(fsd, iip, permissions);
- iip = iip.getExistingINodes();
- // switch the locks
- fsd.getINodeMap().latchWriteLock(iip, missing);
- // Add missing inodes to the INodeMap
- for(INode dir : missing) {
- iip = addSingleDirectory(fsd, iip, dir, permissions);
- assert iip != null : "iip should not be null";
- }
+ iip = createMissingDirs(fsd, iip, permissions);
}
return fsd.getAuditFileInfo(iip);
} finally {
fsd.writeUnlock();
}
}
+ public static INodesInPath createMissingDirs(FSDirectory fsd,
Review comment:
You don't really need it public, right? You should use most restrictive
modifiers. One can always change them later when needed.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirWriteFileOp.java
##########
@@ -393,7 +400,7 @@ static HdfsFileStatus startFile(
fsn.checkFsObjectLimit();
INodeFile newNode = null;
INodesInPath parent =
- FSDirMkdirOp.createAncestorDirectories(fsd, iip, permissions);
+ FSDirMkdirOp.createMissingDirs(fsd, iip.getParentINodesInPath(),
permissions);
Review comment:
Could you please check for a long lines. They should not exceed 80
symbols per Hadoop code style.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirMkdirOp.java
##########
@@ -251,7 +260,10 @@ private static INode createDirectoryINode(FSDirectory fsd,
return dir;
}
- private static INode[] createPathDirectories(FSDirectory fsd,
+ /**
+ * Find-out missing iNodes for the current mkdir OP
+ */
+ public static INode[] createPathDirectories(FSDirectory fsd,
Review comment:
Don't really need this to be public.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]