Search in sources :

Example 1 with JobTokenSecretManager

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);
    }
}
Also used : LlapTaskUmbilicalProtocol(org.apache.hadoop.hive.llap.protocol.LlapTaskUmbilicalProtocol) Configuration(org.apache.hadoop.conf.Configuration) TezConfiguration(org.apache.tez.dag.api.TezConfiguration) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException) JobTokenSecretManager(org.apache.tez.common.security.JobTokenSecretManager) IOException(java.io.IOException)

Example 2 with JobTokenSecretManager

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;
}
Also used : JobTokenSecretManager(org.apache.tez.common.security.JobTokenSecretManager) JobTokenIdentifier(org.apache.tez.common.security.JobTokenIdentifier) Text(org.apache.hadoop.io.Text) Token(org.apache.hadoop.security.token.Token)

Aggregations

JobTokenSecretManager (org.apache.tez.common.security.JobTokenSecretManager)2 IOException (java.io.IOException)1 Configuration (org.apache.hadoop.conf.Configuration)1 LlapTaskUmbilicalProtocol (org.apache.hadoop.hive.llap.protocol.LlapTaskUmbilicalProtocol)1 Text (org.apache.hadoop.io.Text)1 Token (org.apache.hadoop.security.token.Token)1 JobTokenIdentifier (org.apache.tez.common.security.JobTokenIdentifier)1 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)1 TezUncheckedException (org.apache.tez.dag.api.TezUncheckedException)1