private void createSubDirAndSystemProperty(String propertyName, Path parent, String subDirName) {

    String sysValue = System.getProperty(propertyName);

    if (sysValue != null) {
      // There is already a value set. So we do nothing but hope
      // that there will be no conflicts
      LOG.info("System.getProperty(\"" + propertyName + "\") already set to: " + sysValue
        + " so I do NOT create it in " + parent);
      String confValue = conf.get(propertyName);
      if (confValue != null && !confValue.endsWith(sysValue)) {
        LOG.warn(propertyName + " property value differs in configuration and system: "
          + "Configuration=" + confValue + " while System=" + sysValue
          + " Erasing configuration value by system value.");
      }
      conf.set(propertyName, sysValue);
    } else {
      // Ok, it's not set, so we create it as a subdirectory
      createSubDir(propertyName, parent, subDirName);
      System.setProperty(propertyName, conf.get(propertyName));
    }
  }
Home our data in a dir under {@link #DEFAULT_BASE_TEST_DIRECTORY}. Give it a random name so can
have many concurrent tests running if we need to. Moding a System property is not the way to do
concurrent instances -- another instance could grab the temporary value unintentionally -- but
not anything can do about it at moment; single instance only is how the minidfscluster works.
We also create the underlying directory names for hadoop.log.dir, mapreduce.cluster.local.dir
and hadoop.tmp.dir, and set the values in the conf, and as a system property for hadoop.tmp.dir
(We do not create them!).
@return The calculated data test build directory, if newly-created.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java