You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/15 07:02:40 UTC

[GitHub] [hadoop-ozone] rakeshadr opened a new pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name

rakeshadr opened a new pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name
URL: https://github.com/apache/hadoop-ozone/pull/824
 
 
   ## What changes were proposed in this pull request?
   Verified the behavior in the latest code. This issue has been already taken care as part of some of the Ozone FS namespace optimisation changes.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-2682
   
   ## How was this patch tested?
   Added unit test case to validate this.
   

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


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] mukul1987 merged pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name

Posted by GitBox <gi...@apache.org>.
mukul1987 merged pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name
URL: https://github.com/apache/hadoop-ozone/pull/824
 
 
   

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


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] rakeshadr commented on a change in pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name

Posted by GitBox <gi...@apache.org>.
rakeshadr commented on a change in pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name
URL: https://github.com/apache/hadoop-ozone/pull/824#discussion_r408800719
 
 

 ##########
 File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
 ##########
 @@ -65,6 +68,110 @@
   private int rootItemCount;
 
   @Test(timeout = 300_000)
+  public void testCreateFileShouldCheckTheExistenceOfDirWithSameName() throws Exception {
+    /*
+     * Op 1. create file -> /d1/d2/d3/d4/key2
+     * Op 2. create dir -> /d1/d2/d3/d4/key2
+     *
+     * Reverse of the above steps
+     * Op 2. create dir -> /d1/d2/d3/d4/key3
+     * Op 1. create file -> /d1/d2/d3/d4/key3
+     *
+     * Op 3. create file -> /d1/d2/d3 (d3 as a file inside /d1/d2)
+     */
+    OzoneConfiguration conf = new OzoneConfiguration();
+    cluster = MiniOzoneCluster.newBuilder(conf)
+            .setNumDatanodes(3)
+            .build();
+    cluster.waitForClusterToBeReady();
+    // create a volume and a bucket to be used by OzoneFileSystem
+    OzoneBucket bucket = TestDataUtil.createVolumeAndBucket(cluster);
+    volumeName = bucket.getVolumeName();
+    bucketName = bucket.getName();
+
+    String rootPath = String.format("%s://%s.%s/",
+            OzoneConsts.OZONE_URI_SCHEME, bucket.getName(), bucket.getVolumeName());
+
+    // Set the fs.defaultFS and start the filesystem
+    conf.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, rootPath);
+    fs = FileSystem.get(conf);
 
 Review comment:
   Thanks for the comments. Uploaded the changes.

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


With regards,
Apache Git Services

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


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #824: HDDS-2682: OM File create request does not check for existing directory with the same name
URL: https://github.com/apache/hadoop-ozone/pull/824#discussion_r408662054
 
 

 ##########
 File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
 ##########
 @@ -65,6 +68,110 @@
   private int rootItemCount;
 
   @Test(timeout = 300_000)
+  public void testCreateFileShouldCheckTheExistenceOfDirWithSameName() throws Exception {
+    /*
+     * Op 1. create file -> /d1/d2/d3/d4/key2
+     * Op 2. create dir -> /d1/d2/d3/d4/key2
+     *
+     * Reverse of the above steps
+     * Op 2. create dir -> /d1/d2/d3/d4/key3
+     * Op 1. create file -> /d1/d2/d3/d4/key3
+     *
+     * Op 3. create file -> /d1/d2/d3 (d3 as a file inside /d1/d2)
+     */
+    OzoneConfiguration conf = new OzoneConfiguration();
+    cluster = MiniOzoneCluster.newBuilder(conf)
+            .setNumDatanodes(3)
+            .build();
+    cluster.waitForClusterToBeReady();
+    // create a volume and a bucket to be used by OzoneFileSystem
+    OzoneBucket bucket = TestDataUtil.createVolumeAndBucket(cluster);
+    volumeName = bucket.getVolumeName();
+    bucketName = bucket.getName();
+
+    String rootPath = String.format("%s://%s.%s/",
+            OzoneConsts.OZONE_URI_SCHEME, bucket.getName(), bucket.getVolumeName());
+
+    // Set the fs.defaultFS and start the filesystem
+    conf.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, rootPath);
+    fs = FileSystem.get(conf);
 
 Review comment:
   Nit: can you please extract this logic into a helper method, to avoid duplication?

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


With regards,
Apache Git Services

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