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;
}
Aggregations