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));
    }
  }
Sets up a directory for a test to use.
@return New directory path, if created.
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/util/WALPerformanceEvaluationUtil.java