You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2015/06/11 01:30:18 UTC
hbase git commit: HBASE-13878 Set hbase.fs.tmp.dir config in
HBaseTestingUtility.java for Phoenix UT to use
Repository: hbase
Updated Branches:
refs/heads/master 0f9398601 -> 399fddddc
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/399fdddd
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/399fdddd
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/399fdddd
Branch: refs/heads/master
Commit: 399fddddc34802aa755e28806548e10181e5fb92
Parents: 0f93986
Author: Enis Soztutar <en...@apache.org>
Authored: Wed Jun 10 16:30:02 2015 -0700
Committer: Enis Soztutar <en...@apache.org>
Committed: Wed Jun 10 16:30:02 2015 -0700
----------------------------------------------------------------------
.../apache/hadoop/hbase/HBaseTestingUtility.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/399fdddd/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 119a7cd..a6d4d77 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
@@ -1035,6 +1035,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;
}
@@ -1196,6 +1201,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