@@ -899,6 +899,18 @@ public Set<TableName> getIncrementalBackupTableSet(String backupRoot) throws IOE
899899 * @throws IOException exception
900900 */
901901 public void addIncrementalBackupTableSet (Set <TableName > tables , String backupRoot )
902+ throws IOException {
903+ addIncrementalBackupTableSet (tables , backupRoot , -1 );
904+ }
905+
906+ /**
907+ * Add tables to global incremental backup set
908+ * @param tables set of tables
909+ * @param backupRoot root directory path to backup
910+ * @param ts timestamp
911+ * @throws IOException exception
912+ */
913+ public void addIncrementalBackupTableSet (Set <TableName > tables , String backupRoot , long ts )
902914 throws IOException {
903915 if (LOG .isTraceEnabled ()) {
904916 LOG .trace ("Add incremental backup table set to backup system table. ROOT=" + backupRoot
@@ -908,7 +920,7 @@ public void addIncrementalBackupTableSet(Set<TableName> tables, String backupRoo
908920 tables .forEach (table -> LOG .debug (Objects .toString (table )));
909921 }
910922 try (Table table = connection .getTable (tableName )) {
911- Put put = createPutForIncrBackupTableSet (tables , backupRoot );
923+ Put put = createPutForIncrBackupTableSet (tables , backupRoot , ts );
912924 table .put (put );
913925 }
914926 }
@@ -1243,11 +1255,18 @@ private Get createGetForIncrBackupTableSet(String backupRoot) throws IOException
12431255
12441256 /**
12451257 * Creates Put to store incremental backup table set
1246- * @param tables tables
1258+ * @param tables tables
1259+ * @param backupRoot root directory path to backup
1260+ * @param ts timestamp
12471261 * @return put operation
12481262 */
1249- private Put createPutForIncrBackupTableSet (Set <TableName > tables , String backupRoot ) {
1250- Put put = new Put (rowkey (INCR_BACKUP_SET , backupRoot ));
1263+ private Put createPutForIncrBackupTableSet (Set <TableName > tables , String backupRoot , long ts ) {
1264+ Put put ;
1265+ if (ts < 0 ) {
1266+ put = new Put (rowkey (INCR_BACKUP_SET , backupRoot ));
1267+ } else {
1268+ put = new Put (rowkey (INCR_BACKUP_SET , backupRoot ), ts );
1269+ }
12511270 for (TableName table : tables ) {
12521271 put .addColumn (BackupSystemTable .META_FAMILY , Bytes .toBytes (table .getNameAsString ()),
12531272 EMPTY_VALUE );
0 commit comments