sadanand48 commented on code in PR #4478:
URL: https://github.com/apache/ozone/pull/4478#discussion_r1151554904


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystemWithFSO.java:
##########
@@ -137,6 +137,19 @@ public void testRenameDestinationParentDoesntExist() 
throws Exception {
     Assert.assertFalse(getFs().rename(dir2SourcePath, newDestinPath));
   }
 
+  @Test
+  public void testKeyToBucketLevel() throws IOException {

Review Comment:
   nit : `testKeyRenameToBucketLevel`



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OFSPath.java:
##########
@@ -163,6 +163,14 @@ public String getKeyName() {
     return keyName;
   }
 
+  /**
+   * Returns the last element of the KeyName, which can either be a file name
+   * or the leaf directory/bucket.
+   */
+  public String getFileName() {
+    return keyName.substring(keyName.lastIndexOf(OZONE_URI_DELIMITER) + 1);

Review Comment:
   Could use  Paths.getFilename() instead
   ```suggestion
       return Paths.get(keyName).getFileName().toString();
   ```



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OFSPath.java:
##########
@@ -163,6 +163,14 @@ public String getKeyName() {
     return keyName;
   }
 
+  /**
+   * Returns the last element of the KeyName, which can either be a file name
+   * or the leaf directory/bucket.
+   */
+  public String getFileName() {

Review Comment:
   This can be a  directory too  i.e `mv vol1/buck1/dir1/dir2 vol1/buck1/` 



-- 
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]

Reply via email to