public Path replaceHiveResources(HiveResources resources, boolean isAsync) {
    Path dir = null;
    if (this.resources != null) {
      dir = this.resources.dagResourcesDir;
      if (!isAsync) {
        try {
          dir.getFileSystem(conf).delete(dir, true);
        } catch (Exception ex) {
          LOG.error("Failed to delete the old resources directory "
              + dir + "; ignoring " + ex.getLocalizedMessage());
        }
        dir = null;
      }
    }
    this.resources = resources;
    return dir;
  }
Mark session as being in use from TezTask, for safety/debugging purposes.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java