@Nullable public static ThreadMXBean initThreadMxBean() {
    ThreadMXBean mxBean = ManagementFactory.getThreadMXBean();
    if (mxBean != null) {
      if (!mxBean.isCurrentThreadCpuTimeSupported()) {
        LOG.warn("Thread CPU monitoring is not supported");
        return null;
      } else if (!mxBean.isThreadCpuTimeEnabled()) {
        LOG.warn("Thread CPU monitoring is not enabled");
        return null;
      }
    }
    return mxBean;
  }
Login using kerberos and also updates the current logged in user

@param principal  - kerberos principal
@param keytabFile - keytab file
@throws IOException - if keytab file cannot be found
llap-common/src/java/org/apache/hadoop/hive/llap/LlapUtil.java