mukul1987 commented on a change in pull request #782: HDDS-1461. Optimize
listStatus api in OzoneFileSystem
URL: https://github.com/apache/hadoop/pull/782#discussion_r283858738
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -1416,44 +1421,47 @@ public void createDirectory(OmKeyArgs args) throws
IOException {
try {
metadataManager.getLock().acquireBucketLock(volumeName, bucketName);
- // verify bucket exists
- OmBucketInfo bucketInfo = getBucketInfo(volumeName, bucketName);
-
// Check if this is the root of the filesystem.
if (keyName.length() == 0) {
return;
}
- verifyNoFilesInPath(volumeName, bucketName, Paths.get(keyName), false);
- String dir = addTrailingSlashIfNeeded(keyName);
- String dirDbKey =
- metadataManager.getOzoneKey(volumeName, bucketName, dir);
- FileEncryptionInfo encInfo = getFileEncryptionInfo(bucketInfo);
+ Path keyPath = Paths.get(keyName);
+ OzoneFileStatus status =
+ verifyNoFilesInPath(volumeName, bucketName, keyPath, false);
+ if (status != null && OzoneFSUtils.pathToKey(status.getPath())
+ .equals(keyPath.toString())) {
Review comment:
keyName can be used here, as keyPath was derived from that.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]