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

This commit is contained in:
Enis Soztutar 2015-06-10 16:30:02 -07:00
parent b98d279de3
commit f49f296181
1 changed files with 16 additions and 0 deletions

View File

@ -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