use of org.apache.tez.common.security.JobTokenSecretManager in project hive by apache.
the class LlapTaskCommunicator method startRpcServer.
@Override
protected void startRpcServer() {
Configuration conf = getConf();
try {
JobTokenSecretManager jobTokenSecretManager = new JobTokenSecretManager();
jobTokenSecretManager.addTokenForJob(tokenIdentifier, sessionToken);
int numHandlers = HiveConf.getIntVar(conf, ConfVars.LLAP_TASK_COMMUNICATOR_LISTENER_THREAD_COUNT);
server = new RPC.Builder(conf).setProtocol(LlapTaskUmbilicalProtocol.class).setBindAddress("0.0.0.0").setPort(0).setInstance(umbilical).setNumHandlers(numHandlers).setSecretManager(jobTokenSecretManager).build();
if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) {
server.refreshServiceAcl(conf, new LlapUmbilicalPolicyProvider());
}
server.start();
this.address = NetUtils.getConnectAddress(server);
this.amHost = LlapUtil.getAmHostNameFromAddress(address, conf);
LOG.info("Started LlapUmbilical: " + umbilical.getClass().getName() + " at address: " + address + " with numHandlers=" + numHandlers + " using the host name " + amHost);
} catch (IOException e) {
throw new TezUncheckedException(e);
}
}
use of org.apache.tez.common.security.JobTokenSecretManager in project hive by apache.
the class SubmitWorkInfo method createJobToken.
private Token<JobTokenIdentifier> createJobToken() {
String tokenIdentifier = fakeAppId.toString();
JobTokenIdentifier identifier = new JobTokenIdentifier(new Text(tokenIdentifier));
Token<JobTokenIdentifier> sessionToken = new Token<JobTokenIdentifier>(identifier, new JobTokenSecretManager());
sessionToken.setService(identifier.getJobId());
return sessionToken;
}
Aggregations