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