mukul1987 commented on a change in pull request #623: HDDS-2941. file create : 
create key table entries for intermediate directories in the path
URL: https://github.com/apache/hadoop-ozone/pull/623#discussion_r389259516
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
 ##########
 @@ -105,24 +120,37 @@ public static OMPathInfo verifyFilesInPath(
 
         LOG.trace("verifyFiles in Path : " + "/" + volumeName
             + "/" + bucketName + "/" + keyName + ":" + result);
-        return new OMPathInfo(missing, result, inheritAcls);
+        // if file exists, so does the parent. Assert.
+        Preconditions.checkState((result != OMDirectoryResult.FILE_EXISTS)
+            || (parentExists));
+
+        return new OMPathInfo(missing, result, inheritAcls, parentExists);
       }
       keyPath = keyPath.getParent();
     }
 
     if (inheritAcls.isEmpty()) {
-      String bucketKey = omMetadataManager.getBucketKey(volumeName, 
bucketName);
-      inheritAcls = 
omMetadataManager.getBucketTable().get(bucketKey).getAcls();
+      String bucketKey = omMetadataManager.getBucketKey(volumeName,
+          bucketName);
+      inheritAcls = omMetadataManager.getBucketTable().get(bucketKey)
+          .getAcls();
       LOG.trace("Acls inherited from bucket " + bucketName + " are : "
           + inheritAcls);
     }
 
     LOG.trace("verifyFiles in Path : " + volumeName + "/" + bucketName + "/"
         + keyName + ":" + result);
+    // parentExists always true if we are creating inside root dir
+    Preconditions.checkState(!pathIsRootDir(immediateParentPath)
+        || parentExists);
     // Found no files/ directories in the given path.
-    return new OMPathInfo(missing, OMDirectoryResult.NONE, inheritAcls);
+    return new OMPathInfo(missing, OMDirectoryResult.NONE, inheritAcls,
+        parentExists);
 
 Review comment:
   this is false always.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to