private Path getNewDataTestDirOnTestFS() throws IOException {
    // The file system can be either local, mini dfs, or if the configuration
    // is supplied externally, it can be an external cluster FS. If it is a local
    // file system, the tests should use getBaseTestDir, otherwise, we can use
    // the working directory, and create a unique sub dir there
    FileSystem fs = getTestFileSystem();
    Path newDataTestDir;
    String randomStr = getRandomUUID().toString();
    if (fs.getUri().getScheme().equals(FileSystem.getLocal(conf).getUri().getScheme())) {
      newDataTestDir = new Path(getDataTestDir(), randomStr);
      File dataTestDir = new File(newDataTestDir.toString());
      if (deleteOnExit()) {
        dataTestDir.deleteOnExit();
      }
    } else {
      Path base = getBaseTestDirOnTestFS();
      newDataTestDir = new Path(base, randomStr);
      if (deleteOnExit()) {
        fs.deleteOnExit(newDataTestDir);
      }
    }
    return newDataTestDir;
  }
Sets up a new path in test filesystem to be used by tests.
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/util/WALPerformanceEvaluationUtil.java