Search in sources :

Example 1 with TezUncheckedException

use of org.apache.tez.dag.api.TezUncheckedException 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 TezUncheckedException

use of org.apache.tez.dag.api.TezUncheckedException in project hive by apache.

the class Converters method convertToProto.

private static EntityDescriptorProto convertToProto(EntityDescriptor<?> descriptor) {
    EntityDescriptorProto.Builder builder = EntityDescriptorProto.newBuilder();
    builder.setClassName(descriptor.getClassName());
    UserPayload userPayload = descriptor.getUserPayload();
    if (userPayload != null) {
        UserPayloadProto.Builder payloadBuilder = UserPayloadProto.newBuilder();
        if (userPayload.hasPayload()) {
            payloadBuilder.setUserPayload(ByteString.copyFrom(userPayload.getPayload()));
            payloadBuilder.setVersion(userPayload.getVersion());
        }
        builder.setUserPayload(payloadBuilder.build());
    }
    if (descriptor.getHistoryText() != null) {
        try {
            builder.setHistoryText(TezCommonUtils.compressByteArrayToByteString(descriptor.getHistoryText().getBytes("UTF-8")));
        } catch (IOException e) {
            throw new TezUncheckedException(e);
        }
    }
    return builder.build();
}
Also used : UserPayload(org.apache.tez.dag.api.UserPayload) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException) IOException(java.io.IOException) UserPayloadProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.UserPayloadProto) EntityDescriptorProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto)

Aggregations

IOException (java.io.IOException)2 TezUncheckedException (org.apache.tez.dag.api.TezUncheckedException)2 Configuration (org.apache.hadoop.conf.Configuration)1 EntityDescriptorProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto)1 UserPayloadProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.UserPayloadProto)1 LlapTaskUmbilicalProtocol (org.apache.hadoop.hive.llap.protocol.LlapTaskUmbilicalProtocol)1 JobTokenSecretManager (org.apache.tez.common.security.JobTokenSecretManager)1 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)1 UserPayload (org.apache.tez.dag.api.UserPayload)1