vinayakphegde commented on code in PR #7239:
URL: https://github.com/apache/hbase/pull/7239#discussion_r2291710719


##########
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:
   The main reason is to preserve the parent directories. In this case, I want 
to delete all the WAL directories and bulkload directories, but still keep the 
root directory intact. This way, when we restart the continuous backup to the 
same backup directory, the required directory structure will already be in 
place.



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