private void setupJAASConfig(Configuration conf) throws IOException {
    if (!isKerberosEnabled(conf)) {
      // The process has not logged in using keytab
      // this should be a test mode, can't use keytab to authenticate
      // with zookeeper.
      LOGGER.warn("Login is not from keytab");
      return;
    }

    String principal;
    String keytab;
    switch (serverMode) {
    case METASTORE:
      principal = getNonEmptyConfVar(conf, "hive.metastore.kerberos.principal");
      keytab = getNonEmptyConfVar(conf, "hive.metastore.kerberos.keytab.file");
      break;
    case HIVESERVER2:
      principal = getNonEmptyConfVar(conf, "hive.server2.authentication.kerberos.principal");
      keytab = getNonEmptyConfVar(conf, "hive.server2.authentication.kerberos.keytab");
      break;
    default:
      throw new AssertionError("Unexpected server mode " + serverMode);
    }
    SecurityUtils.setZookeeperClientKerberosJaasConfig(principal, keytab);
  }
Default constructor for dynamic instantiation w/ Configurable
(ReflectionUtils does not support Configuration constructor injection).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/security/ZooKeeperTokenStore.java