diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java index ef97b195e287..164ae7e73765 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java @@ -139,10 +139,9 @@ public static void copyTableRegionInfo(Connection conn, BackupInfo backupInfo, C // write a copy of descriptor to the target directory Path target = new Path(backupInfo.getTableBackupDir(table)); FileSystem targetFs = target.getFileSystem(conf); - try (FSTableDescriptors descriptors = - new FSTableDescriptors(targetFs, CommonFSUtils.getRootDir(conf))) { - descriptors.createTableDescriptorForTableDirectory(target, orig, false); - } + FSTableDescriptors descriptors = + new FSTableDescriptors(targetFs, CommonFSUtils.getRootDir(conf)); + descriptors.createTableDescriptorForTableDirectory(target, orig, false); LOG.debug("Attempting to copy table info for:" + table + " target: " + target + " descriptor: " + orig); LOG.debug("Finished copying tableinfo."); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java index 73a714525f01..4326c9852e35 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java @@ -244,14 +244,12 @@ private void merge(String[] backupIds, BackupAdmin client) throws IOException { private void runTestSingle(TableName table) throws IOException { List backupIds = new ArrayList(); - List tableSizes = new ArrayList(); try (Connection conn = util.getConnection(); Admin admin = conn.getAdmin(); BackupAdmin client = new BackupAdminImpl(conn);) { // #0- insert some data to table 'table' loadData(table, rowsInIteration); - tableSizes.add(rowsInIteration); // #1 - create full backup for table first LOG.info("create full backup image for {}", table); @@ -270,7 +268,6 @@ private void runTestSingle(TableName table) throws IOException { // Load data loadData(table, rowsInIteration); - tableSizes.add(rowsInIteration * count); // Do incremental backup builder = new BackupRequest.Builder(); request = builder.withBackupType(BackupType.INCREMENTAL).withTableList(tables) @@ -322,6 +319,7 @@ private String[] allIncremental(List backupIds) { } /** + * Check if backup is succeeded * @param backupId pass backup ID to check status of * @return status of backup */ @@ -429,6 +427,7 @@ protected void processOptions(CommandLine cmd) { } /** + * Main method * @param args argument list */ public static void main(String[] args) throws Exception {