hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject hbase git commit: HBASE-13878 Set hbase.fs.tmp.dir config in HBaseTestingUtility.java for Phoenix UT to use
Date Wed, 10 Jun 2015 23:36:27 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 278440425 -> c2371e651


HBASE-13878 Set hbase.fs.tmp.dir config in HBaseTestingUtility.java for Phoenix UT to use


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

Branch: refs/heads/branch-1.1
Commit: c2371e6516c1cdf2dacae14f10b8608d8b19d891
Parents: 2784404
Author: Enis Soztutar <enis@apache.org>
Authored: Wed Jun 10 16:30:02 2015 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Wed Jun 10 16:35:15 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/HBaseTestingUtility.java    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c2371e65/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 14a0c5a..bf76537 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
@@ -1023,6 +1023,11 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility
{
 
     getHBaseAdmin(); // create immediately the hbaseAdmin
     LOG.info("Minicluster is up");
+
+    // Set the hbase.fs.tmp.dir config to make sure that we have some default value. This
is
+    // for tests that do not read hbase-defaults.xml
+    setHBaseFsTmpDir();
+
     return (MiniHBaseCluster)this.hbaseCluster;
   }
 
@@ -1178,6 +1183,17 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility
{
     return createRootDir(false);
   }
 
+
+  private void setHBaseFsTmpDir() throws IOException {
+    String hbaseFsTmpDirInString = this.conf.get("hbase.fs.tmp.dir");
+    if (hbaseFsTmpDirInString == null) {
+      this.conf.set("hbase.fs.tmp.dir",  getDataTestDirOnTestFS("hbase-staging").toString());
+      LOG.info("Setting hbase.fs.tmp.dir to " + this.conf.get("hbase.fs.tmp.dir"));
+    } else {
+      LOG.info("The hbase.fs.tmp.dir is set to " + hbaseFsTmpDirInString);
+    }
+  }
+
   /**
    * Flushes all caches in the mini hbase cluster
    * @throws IOException


Mime
View raw message