Search in sources :

Example 1 with LlapDaemonPolicyProvider

use of org.apache.hadoop.hive.llap.security.LlapDaemonPolicyProvider in project hive by apache.

the class LlapProtocolServerImpl method createServer.

private RPC.Server createServer(Class<?> pbProtocol, InetSocketAddress addr, Configuration conf, int numHandlers, BlockingService blockingService, 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) {
            // Some value is set.
            if (conf.get(acl.varname) != null)
                continue;
            if (serverConf == conf) {
                serverConf = new Configuration(conf);
            }
            // Set the default.
            serverConf.set(acl.varname, HiveConf.getVar(serverConf, acl));
        }
    }
    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, new LlapDaemonPolicyProvider());
    }
    return server;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) RPC(org.apache.hadoop.ipc.RPC) LlapDaemonPolicyProvider(org.apache.hadoop.hive.llap.security.LlapDaemonPolicyProvider) ConfVars(org.apache.hadoop.hive.conf.HiveConf.ConfVars)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)1 ConfVars (org.apache.hadoop.hive.conf.HiveConf.ConfVars)1 LlapDaemonPolicyProvider (org.apache.hadoop.hive.llap.security.LlapDaemonPolicyProvider)1 RPC (org.apache.hadoop.ipc.RPC)1