public static RPC.Server createRpcServer(Class<?> pbProtocol, InetSocketAddress addr,
      Configuration conf, int numHandlers, BlockingService blockingService,
      SecretManager<?> secretManager, PolicyProvider provider, ConfVars... aclVars)
          throws IOException {
    Configuration serverConf = conf;
    boolean isSecurityEnabled = conf.getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false);
    if (isSecurityEnabled) {
      // Enforce Hive defaults.
      for (ConfVars acl : aclVars) {
        if (conf.get(acl.varname) != null) continue; // Some value is set.
        if (serverConf == conf) {
          serverConf = new Configuration(conf);
        }
        serverConf.set(acl.varname, HiveConf.getVar(serverConf, acl)); // Set the default.
      }
    }
    RPC.setProtocolEngine(serverConf, pbProtocol, ProtobufRpcEngine.class);
    RPC.Builder builder = new RPC.Builder(serverConf)
        .setProtocol(pbProtocol)
        .setInstance(blockingService)
        .setBindAddress(addr.getHostName())
        .setPort(addr.getPort())
        .setNumHandlers(numHandlers);
    if (secretManager != null) {
      builder = builder.setSecretManager(secretManager);
    }
    RPC.Server server = builder.build();
    if (isSecurityEnabled) {
      server.refreshServiceAcl(serverConf, provider);
    }
    return server;
  }
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