hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1506206 - /hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java
Date Tue, 23 Jul 2013 18:42:38 GMT
Author: jxiang
Date: Tue Jul 23 18:42:38 2013
New Revision: 1506206

URL: http://svn.apache.org/r1506206
Log:
HBASE-9020 Make hbase-it HBASE_HOME configurable

Modified:
    hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java

Modified: hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java?rev=1506206&r1=1506205&r2=1506206&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java
(original)
+++ hbase/branches/0.95/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java
Tue Jul 23 18:42:38 2013
@@ -143,21 +143,24 @@ public class HBaseClusterManager extends
    * CommandProvider to manage the service using bin/hbase-* scripts
    */
   static class HBaseShellCommandProvider extends CommandProvider {
-    private String getHBaseHome() {
-      return System.getenv("HBASE_HOME");
-    }
+    private final String hbaseHome;
+    private final String confDir;
 
-    private String getConfig() {
-      String confDir = System.getenv("HBASE_CONF_DIR");
-      if (confDir != null) {
-        return String.format("--config %s", confDir);
+    HBaseShellCommandProvider(Configuration conf) {
+      hbaseHome = conf.get("hbase.it.clustermanager.hbase.home",
+        System.getenv("HBASE_HOME"));
+      String tmp = conf.get("hbase.it.clustermanager.hbase.conf.dir",
+        System.getenv("HBASE_CONF_DIR"));
+      if (tmp != null) {
+        confDir = String.format("--config %s", tmp);
+      } else {
+        confDir = "";
       }
-      return "";
     }
 
     @Override
     public String getCommand(ServiceType service, Operation op) {
-      return String.format("%s/bin/hbase-daemon.sh %s %s %s", getHBaseHome(), getConfig(),
+      return String.format("%s/bin/hbase-daemon.sh %s %s %s", hbaseHome, confDir,
           op.toString().toLowerCase(), service);
     }
   }
@@ -169,7 +172,7 @@ public class HBaseClusterManager extends
   protected CommandProvider getCommandProvider(ServiceType service) {
     //TODO: make it pluggable, or auto-detect the best command provider, should work with
     //hadoop daemons as well
-    return new HBaseShellCommandProvider();
+    return new HBaseShellCommandProvider(getConf());
   }
 
   /**



Mime
View raw message