Repository: hbase Updated Branches: refs/heads/HBASE-14850 9aa4b16b7 -> 2aceb22f7
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/2aceb22f Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2aceb22f Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2aceb22f Branch: refs/heads/HBASE-14850 Commit: 2aceb22f7f11bb3c5cbfde09acccfcf10cf59eef Parents: 9aa4b16 Author: tedyu <yuzhih...@gmail.com> Authored: Fri Feb 10 17:54:39 2017 -0800 Committer: tedyu <yuzhih...@gmail.com> Committed: Fri Feb 10 17:54:39 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/2aceb22f/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 bfa14cb..340c24a 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 @@ -193,6 +193,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. @@ -350,8 +352,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; } @@ -1040,9 +1044,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) {