public static File createLocalDirsTempFile(Configuration conf, String prefix, String suffix,
      boolean isDirectory) throws IOException {
    return createLocalDirsTempFile(
        conf.get("yarn.nodemanager.local-dirs"), prefix, suffix, isDirectory);
  }
create temporary file and register it to delete-on-exit hook.
File.deleteOnExit is not used for possible memory leakage.

Make sure to use {@link #deleteTmpFile(File)} after the file is no longer required,
and has been deleted to avoid a memory leak.
common/src/java/org/apache/hadoop/hive/common/FileUtils.java