public String getAppMasterUri() {
    return Optional.of(getSession()).map(
            tezClient -> tezClient.getAmHost() + ":" + tezClient.getAmPort())
        .get();
  }
Mark session as being in use from TezTask, for safety/debugging purposes.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java