Kota-SH commented on code in PR #7239:
URL: https://github.com/apache/hbase/pull/7239#discussion_r2291498356


##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java:
##########
@@ -1014,6 +1015,15 @@ private void deleteAllBackupWALFiles(Configuration conf, 
String backupWalDir)
           System.out.println("Deleted all contents under WAL directory: " + 
walDir);
         }
 
+        // Delete contents under bulk load directory
+        if (fs.exists(bulkloadDir)) {
+          FileStatus[] bulkContents = fs.listStatus(bulkloadDir);
+          for (FileStatus item : bulkContents) {
+            fs.delete(item.getPath(), true); // recursive delete of each child
+          }
+          System.out.println("Deleted all contents under Bulk Load directory: 
" + bulkloadDir);

Review Comment:
   Is there a specific reason you chose to loop and delete the contents 
individually?
   I think a single recursive fs.delete() here would reduce RPCs (like in line 
1072 in deleteOldWALFiles())



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

Reply via email to