DieterDP-ng commented on code in PR #5868: URL: https://github.com/apache/hbase/pull/5868#discussion_r1620230862
########## hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/TableBackupClient.java: ########## @@ -281,13 +284,65 @@ protected void addManifest(BackupInfo backupInfo, BackupManager backupManager, B // set the table region server start and end timestamps for incremental backup manifest.setIncrTimestampMap(backupInfo.getIncrTimestampMap()); } - ArrayList<BackupImage> ancestors = backupManager.getAncestors(backupInfo); + List<BackupImage> ancestors = getAncestors(backupInfo); for (BackupImage image : ancestors) { manifest.addDependentImage(image); } manifest.store(conf); } + /** + * Gets the direct ancestors of the currently being created backup. + * @param backupInfo The backup info for the backup being created + */ + protected List<BackupImage> getAncestors(BackupInfo backupInfo) throws IOException { + LOG.debug("Getting the direct ancestors of the current backup {}", backupInfo.getBackupId()); + + // Full backups do not have ancestors + if (backupInfo.getType() == BackupType.FULL) { + LOG.debug("Current backup is a full backup, no direct ancestor for it."); + return Collections.emptyList(); + } + + List<BackupImage> ancestors = new ArrayList<>(); Review Comment: I don't see a need for it. Since we're iterating over a list of unique possible ancestors, we can't end up with duplicates. -- 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: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org