taklwu commented on code in PR #7090:
URL: https://github.com/apache/hbase/pull/7090#discussion_r2141303125
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java:
##########
@@ -966,6 +988,34 @@ void updateBackupTableStartTimes(BackupSystemTable
sysTable, long cutoffTimestam
}
}
+ private void removeAllTablesFromContinuousBackup(BackupSystemTable
sysTable)
+ throws IOException {
+ Map<TableName, Long> allTables = sysTable.getContinuousBackupTableSet();
+ if (!allTables.isEmpty()) {
+ sysTable.removeContinuousBackupTableSet(allTables.keySet());
+ System.out.println("Removed all tables from continuous backup
metadata.");
+ }
+ }
+
+ private void deleteAllBackupWALFiles(Configuration conf, String
backupWalDir)
+ throws IOException {
+ try {
+ FileSystem fs = FileSystem.get(conf);
+ Path walPath = new Path(backupWalDir);
+ if (fs.exists(walPath)) {
+ FileStatus[] contents = fs.listStatus(walPath);
+ for (FileStatus item : contents) {
+ fs.delete(item.getPath(), true); // recursive delete of each child
+ }
+ System.out.println("Deleted all contents under WAL directory: " +
backupWalDir);
+ }
+ } catch (IOException e) {
Review Comment:
nit and out of scope.
there are potential problems of this delete wal directory if the amount of
WALs are huge list of files.
1. if there is many paths need to be removed for WAL, this may take long on
non-HDFS filesystem (but our use cases are always using HDFS)
2. we don't have any knowledge if this may take times and we don't have a
preview for deleting what files. also without the instrument of LOGGER DEBUG to
tell if something is being deleted, this lacks visibility..
I found most of other code did the same, so, just FYI I'm wondered we should
introduce LOGGER DEBUG and see if that would at least tell the CLI user that
something is happening.
--
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]