HBASE-20547 Restore from backup will fail if done from a different file system

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Vladimir Rodionov 2018-05-15 12:10:40 -07:00 committed by tedyu
parent 438af9bf74
commit 6d656b7e71
2 changed files with 3 additions and 1 deletions

View File

@ -361,6 +361,7 @@ public class IncrementalTableBackupClient extends TableBackupClient {
protected void deleteBulkLoadDirectory() throws IOException { protected void deleteBulkLoadDirectory() throws IOException {
// delete original bulk load directory on method exit // delete original bulk load directory on method exit
Path path = getBulkOutputDir(); Path path = getBulkOutputDir();
FileSystem fs = FileSystem.get(path.toUri(), conf);
boolean result = fs.delete(path, true); boolean result = fs.delete(path, true);
if (!result) { if (!result) {
LOG.warn("Could not delete " + path); LOG.warn("Could not delete " + path);

View File

@ -563,7 +563,8 @@ public final class BackupUtils {
private static List<BackupInfo> getHistory(Configuration conf, Path backupRootPath) private static List<BackupInfo> getHistory(Configuration conf, Path backupRootPath)
throws IOException { throws IOException {
// Get all (n) history from backup root destination // Get all (n) history from backup root destination
FileSystem fs = FileSystem.get(conf);
FileSystem fs = FileSystem.get(backupRootPath.toUri(), conf);
RemoteIterator<LocatedFileStatus> it = fs.listLocatedStatus(backupRootPath); RemoteIterator<LocatedFileStatus> it = fs.listLocatedStatus(backupRootPath);
List<BackupInfo> infos = new ArrayList<>(); List<BackupInfo> infos = new ArrayList<>();