Will Berkeley has uploaded this change for review. ( http://gerrit.cloudera.org:8080/13405
Change subject: [backup] Add a tool to clean up old backups ...................................................................... [backup] Add a tool to clean up old backups This adds a tool that cleans up old backups. Eligibility for cleanup is a property of the backup path, not the actual backup. There are two conditions: 1. The path is not the restore path. 2. Every backup on the path is older than the expiration age, which the tool allows users to express in days. The default is 30 days. If a path satisfies both conditions, the tool will delete its backups, from most recent to least recent. This way, if the tool terminates mid-delete, the next run of the tool can pick up where the previous one left off. The tool has a dry run mode, a verbose mode, and a table name filter. It does not normally output anything on success. There are a couple of situations not currently handled by this tool: 1. Failed backups with no metadata. 2. Backup paths with no full backup at the beginning. This is because the backup graph abstraction doesn't presently handle these cases in a way the tool can use. The tool can be further improved after a follow up to enhance the backup graph. Change-Id: I4a4c4dde10ec3c3c9b2233ee2f7b13c46e963e39 --- M java/kudu-backup-tools/src/main/scala/org/apache/kudu/backup/BackupIO.scala A java/kudu-backup-tools/src/main/scala/org/apache/kudu/backup/KuduBackupCleaner.scala M java/kudu-backup-tools/src/test/scala/org/apache/kudu/backup/TestKuduBackupCLI.scala A java/kudu-backup-tools/src/test/scala/org/apache/kudu/backup/TestKuduBackupCleaner.scala A java/kudu-backup-tools/src/test/scala/org/apache/kudu/backup/TestUtils.scala 5 files changed, 317 insertions(+), 28 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/05/13405/1 -- To view, visit http://gerrit.cloudera.org:8080/13405 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4a4c4dde10ec3c3c9b2233ee2f7b13c46e963e39 Gerrit-Change-Number: 13405 Gerrit-PatchSet: 1 Gerrit-Owner: Will Berkeley <[email protected]>
