From 6d656b7e71e38c32a65026df6196108e6a60ca0a Mon Sep 17 00:00:00 2001 From: Vladimir Rodionov Date: Tue, 15 May 2018 12:10:40 -0700 Subject: [PATCH] HBASE-20547 Restore from backup will fail if done from a different file system Signed-off-by: tedyu --- .../hadoop/hbase/backup/impl/IncrementalTableBackupClient.java | 1 + .../java/org/apache/hadoop/hbase/backup/util/BackupUtils.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java index 8fd65735f25..43824d78d03 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java @@ -361,6 +361,7 @@ public class IncrementalTableBackupClient extends TableBackupClient { protected void deleteBulkLoadDirectory() throws IOException { // delete original bulk load directory on method exit Path path = getBulkOutputDir(); + FileSystem fs = FileSystem.get(path.toUri(), conf); boolean result = fs.delete(path, true); if (!result) { LOG.warn("Could not delete " + path); 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 96ecab9fd37..e01849ae103 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 @@ -563,7 +563,8 @@ public final class BackupUtils { private static List getHistory(Configuration conf, Path backupRootPath) throws IOException { // Get all (n) history from backup root destination - FileSystem fs = FileSystem.get(conf); + + FileSystem fs = FileSystem.get(backupRootPath.toUri(), conf); RemoteIterator it = fs.listLocatedStatus(backupRootPath); List infos = new ArrayList<>();