neils-dev commented on code in PR #4405:
URL: https://github.com/apache/ozone/pull/4405#discussion_r1155258333


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java:
##########
@@ -657,8 +657,9 @@ private FileStatusAdapter getFileStatusForKeyOrSnapshot(
       OFSPath ofsPath, URI uri, Path qualifiedPath, String userName)
       throws IOException {
     String key = ofsPath.getKeyName();
+    OzoneBucket bucket = null;

Review Comment:
   Nit: unnecessary change.  Variable `bucket` only used in scope of try block 
and can remain declared there.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -720,6 +670,101 @@ public boolean delete(Path f, boolean recursive) throws 
IOException {
     return result;
   }
 
+  private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
+      throws IOException {
+    // check status of normal bucket
+    try {
+      getFileStatus(f);
+    } catch (FileNotFoundException ex) {
+      // remove orphan link bucket directly
+      if (isLinkBucket(f, ofsPath)) {

Review Comment:
   Within this catch block we can just check `if isLinkBucket == false` and 
return `LOG.warn(Path does not exist)` with `false`.  Outside the catch block 
the bucket is checked if link, if true, then the orphan bucket is removed from 
volume and returned. 



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