Copilot commented on code in PR #8858:
URL: https://github.com/apache/ozone/pull/8858#discussion_r2337082003


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMDirectoriesPurgeRequestWithFSO.java:
##########
@@ -172,22 +205,38 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
           }
         }
         if (path.hasDeletedDir()) {
+          deletedDirNames.add(path.getDeletedDir());
           numDirsDeleted++;
         }
       }
+      
+      // Remove deletedDirNames from subDirNames to avoid duplication
+      subDirNames.removeAll(deletedDirNames);
+      numSubDirMoved = subDirNames.size();

Review Comment:
   The variable `numSubDirMoved` is being reassigned after it was already 
incremented in the loop (line 142 was removed). This logic change affects the 
metrics calculation and could cause incorrect audit logging counts.
   ```suggestion
   
   ```



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMDirectoriesPurgeRequestWithFSO.java:
##########
@@ -55,12 +59,21 @@
  * Handles purging of keys from OM DB.
  */
 public class OMDirectoriesPurgeRequestWithFSO extends OMKeyRequest {
+  private static final AuditLogger AUDIT = new 
AuditLogger(AuditLoggerType.OMSYSTEMLOGGER);
+  private static final String AUDIT_PARAM_DIRS_DELETED = "directoriesDeleted";
+  private static final String AUDIT_PARAM_SUBDIRS_MOVED = 
"subdirectoriesMoved";
+  private static final String AUDIT_PARAM_SUBFILES_MOVED = "subFilesMoved";
+  private static final String AUDIT_PARAM_DIRS_DELETED_LIST = 
"directoriesDeletedList";
+  private static final String AUDIT_PARAM_SUBDIRS_MOVED_LIST = 
"subdirectoriesMovedList";
+  private static final String AUDIT_PARAM_SUBFILES_MOVED_LIST = 
"subFilesMovedList";
+  private static final String AUDIT_PARAM_SNAPSHOT_ID = "snapshotId";
 
   public OMDirectoriesPurgeRequestWithFSO(OMRequest omRequest) {
     super(omRequest, BucketLayout.FILE_SYSTEM_OPTIMIZED);
   }
 
   @Override
+  @SuppressWarnings("methodlength")

Review Comment:
   [nitpick] Adding a SuppressWarnings annotation for method length suggests 
this method is becoming too complex. Consider breaking it into smaller, more 
focused methods for better maintainability.



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