You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/04/21 23:04:46 UTC

[hbase] branch master updated: HBASE-24226 Address other hard references to '/tmp' found in Configuration

This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new e5a3c93  HBASE-24226 Address other hard references to '/tmp' found in Configuration
e5a3c93 is described below

commit e5a3c9320e17dbb9a0737047c403e59ad280acc0
Author: stack <st...@apache.org>
AuthorDate: Tue Apr 21 15:53:29 2020 -0700

    HBASE-24226 Address other hard references to '/tmp' found in Configuration
---
 .../hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java      | 11 +++++++++++
 .../java/org/apache/hadoop/hbase/HBaseTestingUtility.java     | 11 ++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java
index 10bf10c..8ebedb9 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java
@@ -70,6 +70,17 @@ public class TestExportSnapshotAdjunct {
     TestExportSnapshot.setUpBaseConf(TEST_UTIL.getConfiguration());
     TEST_UTIL.startMiniCluster(3);
     TEST_UTIL.startMiniMapReduceCluster();
+  }
+
+  /**
+   * Check for references to '/tmp'. We are trying to avoid having references to outside of the
+   * test data dir when running tests. References outside of the test dir makes it so concurrent
+   * tests can stamp on each other by mistake. This check is for references to the 'tmp'.
+   *
+   * This is a strange place for this test but I want somewhere where the configuration is
+   * full -- filed w/ hdfs and mapreduce configurations.
+   */
+  private void checkForReferencesToTmpDir() {
     Configuration conf = TEST_UTIL.getConfiguration();
     for (Iterator<Map.Entry<String, String>> i = conf.iterator(); i.hasNext();) {
       Map.Entry<String, String> e = i.next();
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 27bf441..4f37556 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
@@ -648,11 +648,11 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
     setupClusterTestDir();
     conf.set(TEST_DIRECTORY_KEY, clusterTestDir.getPath());
     System.setProperty(TEST_DIRECTORY_KEY, clusterTestDir.getPath());
-    createDirAndSetProperty("test.cache.data", "test.cache.data");
-    createDirAndSetProperty("hadoop.tmp.dir", "hadoop.tmp.dir");
-    hadoopLogDir = createDirAndSetProperty("hadoop.log.dir", "hadoop.log.dir");
-    createDirAndSetProperty("mapreduce.cluster.local.dir", "mapreduce.cluster.local.dir");
-    createDirAndSetProperty("mapreduce.cluster.temp.dir", "mapreduce.cluster.temp.dir");
+    createDirAndSetProperty("test.cache.data");
+    createDirAndSetProperty("hadoop.tmp.dir");
+    hadoopLogDir = createDirAndSetProperty("hadoop.log.dir");
+    createDirAndSetProperty("mapreduce.cluster.local.dir");
+    createDirAndSetProperty("mapreduce.cluster.temp.dir");
     enableShortCircuit();
 
     Path root = getDataTestDirOnTestFS("hadoop");
@@ -680,6 +680,7 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
     createDirAndSetProperty("java.io.tmpdir");
     createDirAndSetProperty("dfs.journalnode.edits.dir");
     createDirAndSetProperty("dfs.provided.aliasmap.inmemory.leveldb.dir");
+    createDirAndSetProperty("fs.s3a.committer.staging.tmp.path");
   }
 
   /**