Repository: hbase
Updated Branches:
  refs/heads/HBASE-7912 9828ffe44 -> 3834f411b


HBASE-16826 Backup command-line tool fails if defaultFS is not set in 
configuration (Vladimir Rodionov)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3834f411
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3834f411
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3834f411

Branch: refs/heads/HBASE-7912
Commit: 3834f411b09b43d738bd763ab7201c914aeb4d4d
Parents: 9828ffe
Author: tedyu <yuzhih...@gmail.com>
Authored: Fri Oct 14 15:02:58 2016 -0700
Committer: tedyu <yuzhih...@gmail.com>
Committed: Fri Oct 14 15:02:58 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/backup/BackupDriver.java | 6 ++++++
 .../java/org/apache/hadoop/hbase/backup/RestoreDriver.java     | 6 ++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3834f411/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/BackupDriver.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/BackupDriver.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/BackupDriver.java
index 2430ce5..57c7a12 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/BackupDriver.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/BackupDriver.java
@@ -18,17 +18,20 @@
 package org.apache.hadoop.hbase.backup;
 
 import java.io.IOException;
+import java.net.URI;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.backup.impl.BackupCommands;
 import 
org.apache.hadoop.hbase.backup.impl.BackupRestoreConstants.BackupCommand;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.util.AbstractHBaseTool;
+import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.LogUtils;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.log4j.Level;
@@ -137,6 +140,9 @@ public class BackupDriver extends AbstractHBaseTool {
 
   public static void main(String[] args) throws Exception {
     Configuration conf = HBaseConfiguration.create();
+    Path hbasedir = FSUtils.getRootDir(conf);
+    URI defaultFs = hbasedir.getFileSystem(conf).getUri();
+    FSUtils.setFsDefault(conf, new Path(defaultFs));
     int ret = ToolRunner.run(conf, new BackupDriver(), args);    
     System.exit(ret);    
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3834f411/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java
index ce3bb65..882e212 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java
@@ -18,6 +18,7 @@
 package org.apache.hadoop.hbase.backup;
 
 import java.io.IOException;
+import java.net.URI;
 import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
@@ -25,6 +26,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.backup.impl.BackupRestoreConstants;
@@ -35,6 +37,7 @@ import org.apache.hadoop.hbase.backup.util.RestoreServerUtil;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.util.AbstractHBaseTool;
+import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.LogUtils;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.log4j.Level;
@@ -190,6 +193,9 @@ public class RestoreDriver extends AbstractHBaseTool {
 
   public static void main(String[] args) throws Exception {
     Configuration conf = HBaseConfiguration.create();
+    Path hbasedir = FSUtils.getRootDir(conf);
+    URI defaultFs = hbasedir.getFileSystem(conf).getUri();
+    FSUtils.setFsDefault(conf, new Path(defaultFs));
     int ret = ToolRunner.run(conf, new RestoreDriver(), args);
     System.exit(ret);
   }

Reply via email to