public static void killRunningJobs() {
    try {
      if (KILL_RUNNING_TEZ_JOBS != null) {
        KILL_RUNNING_TEZ_JOBS.invoke(null, null);
      } else {
        LOG.warn("Unable to find tez method for killing jobs");
      }
    } catch (Exception e) {
      // It is not available do nothing
      LOG.error("Could not stop tez dags: ", e);
    }
  }
TezJobExecHelper is a utility to safely call Tez functionality from
common code paths. It will check if tez is available/installed before
invoking the code.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobExecHelper.java