Repository: hbase
Updated Branches:
  refs/heads/master d51e28787 -> a05abd83e


HBASE-17628 Local mode of mini cluster shouldn't use hdfs (Devaraj Das)


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

Branch: refs/heads/master
Commit: a05abd83effd8e4c0abff7acf1b5f33f8609295f
Parents: d51e287
Author: tedyu <yuzhih...@gmail.com>
Authored: Fri Feb 10 17:52:33 2017 -0800
Committer: tedyu <yuzhih...@gmail.com>
Committed: Fri Feb 10 17:52:33 2017 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/HBaseTestingUtility.java     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a05abd83/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 4539f97..aaee994 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -197,6 +197,8 @@ public class HBaseTestingUtility extends 
HBaseCommonTestingUtility {
    */
   private volatile Connection connection;
 
+  private boolean localMode = false;
+
   /**
    * System property key to get test directory value.
    * Name is as it is because mini dfs has hard-codings to put test data here.
@@ -354,8 +356,10 @@ public class HBaseTestingUtility extends 
HBaseCommonTestingUtility {
   public static HBaseTestingUtility createLocalHTU(Configuration c) {
     HBaseTestingUtility htu = new HBaseTestingUtility(c);
     String dataTestDir = htu.getDataTestDir().toString();
-    htu.getConfiguration().set(HConstants.HBASE_DIR, dataTestDir);
+    htu.getConfiguration().set("fs.defaultFS","file:///");
+    htu.getConfiguration().set(HConstants.HBASE_DIR, "file://" + dataTestDir);
     LOG.debug("Setting " + HConstants.HBASE_DIR + " to " + dataTestDir);
+    htu.localMode = true;
     return htu;
   }
 
@@ -1059,9 +1063,10 @@ public class HBaseTestingUtility extends 
HBaseCommonTestingUtility {
 
     // Bring up mini dfs cluster. This spews a bunch of warnings about missing
     // scheme. Complaints are 'Scheme is undefined for 
build/test/data/dfs/name1'.
-    if(this.dfsCluster == null) {
+    if(this.dfsCluster == null && !localMode) {
+      LOG.info("STARTING DFS");
       dfsCluster = startMiniDFSCluster(numDataNodes, dataNodeHosts);
-    }
+    } else LOG.info("NOT STARTING DFS");
 
     // Start up a zk cluster.
     if (this.zkCluster == null) {

Reply via email to