aryangupta1998 commented on code in PR #5580:
URL: https://github.com/apache/ozone/pull/5580#discussion_r1407365105


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFsDelete.java:
##########
@@ -139,10 +140,25 @@ protected void processPath(PathData item) throws 
IOException {
       if (moveToTrash(item) || !canBeSafelyDeleted(item)) {
         return;
       }
-      if (!item.fs.delete(path, deleteDirs)) {
+      BasicRootedOzoneFileSystem.InnerDeleteResult innerDeleteResult = null;
+      if (item.fs.getUri().getScheme().equals(OZONE_OFS_URI_SCHEME)) {
+        BasicRootedOzoneFileSystem ofs = (BasicRootedOzoneFileSystem) item.fs;
+        innerDeleteResult = ofs.deleteKeys(path, deleteDirs);
+      } else {
+        if (!item.fs.delete(path, deleteDirs)) {
+          throw new PathIOException(item.toString());
+        }
+      }
+      if (innerDeleteResult != null && !innerDeleteResult.isSuccess()) {
         throw new PathIOException(item.toString());
       }
-      out.println("Deleted " + item + (trailing ? OZONE_URI_DELIMITER : ""));
+      if (innerDeleteResult != null && innerDeleteResult.isPartiallyDeleted()) 
{
+        out.println(
+            "Path might not have been deleted completely: " + item + (trailing 
?

Review Comment:
   Done



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFsDelete.java:
##########
@@ -139,10 +140,25 @@ protected void processPath(PathData item) throws 
IOException {
       if (moveToTrash(item) || !canBeSafelyDeleted(item)) {
         return;
       }
-      if (!item.fs.delete(path, deleteDirs)) {
+      BasicRootedOzoneFileSystem.InnerDeleteResult innerDeleteResult = null;
+      if (item.fs.getUri().getScheme().equals(OZONE_OFS_URI_SCHEME)) {
+        BasicRootedOzoneFileSystem ofs = (BasicRootedOzoneFileSystem) item.fs;
+        innerDeleteResult = ofs.deleteKeys(path, deleteDirs);
+      } else {
+        if (!item.fs.delete(path, deleteDirs)) {
+          throw new PathIOException(item.toString());
+        }
+      }
+      if (innerDeleteResult != null && !innerDeleteResult.isSuccess()) {
         throw new PathIOException(item.toString());
       }
-      out.println("Deleted " + item + (trailing ? OZONE_URI_DELIMITER : ""));
+      if (innerDeleteResult != null && innerDeleteResult.isPartiallyDeleted()) 
{
+        out.println(
+            "Path might not have been deleted completely: " + item + (trailing 
?
+                OZONE_URI_DELIMITER : ""));

Review Comment:
   Done



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