abhradeepkundu commented on code in PR #7007:
URL: https://github.com/apache/hbase/pull/7007#discussion_r2125610012
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java:
##########
@@ -876,6 +890,140 @@ private boolean canAnyOtherBackupCover(List<BackupInfo>
allBackups, BackupInfo c
return false;
}
+ /**
+ * Cleans up Write-Ahead Logs (WALs) that are no longer required for PITR
after a successful
+ * backup deletion.
+ */
+ private void cleanUpUnusedBackupWALs() throws IOException {
+ Configuration conf = getConf() != null ? getConf() :
HBaseConfiguration.create();
+ String backupWalDir = conf.get(CONF_CONTINUOUS_BACKUP_WAL_DIR);
+
+ if (Strings.isNullOrEmpty(backupWalDir)) {
+ System.out.println("No WAL directory specified for continuous backup.
Skipping cleanup.");
+ return;
+ }
+
+ try (Connection conn = ConnectionFactory.createConnection(conf);
Review Comment:
This connection creation is unnecessary I feel. Super class already has a
connection open. Please verify. If you can reuse it.
--
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]