use of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPBServerImpl in project tez by apache.
the class DAGClientServer method serviceStart.
@Override
public void serviceStart() {
try {
Configuration conf = getConfig();
InetSocketAddress addr = new InetSocketAddress(0);
DAGClientAMProtocolBlockingPBServerImpl service = new DAGClientAMProtocolBlockingPBServerImpl(realInstance, stagingFs);
BlockingService blockingService = DAGClientAMProtocol.newReflectiveBlockingService(service);
int numHandlers = conf.getInt(TezConfiguration.TEZ_AM_CLIENT_THREAD_COUNT, TezConfiguration.TEZ_AM_CLIENT_THREAD_COUNT_DEFAULT);
if (numHandlers < 2) {
numHandlers = 2;
}
server = createServer(DAGClientAMProtocolBlockingPB.class, addr, conf, numHandlers, blockingService, TezConfiguration.TEZ_AM_CLIENT_AM_PORT_RANGE);
// Enable service authorization?
if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) {
refreshServiceAcls(conf, new TezAMPolicyProvider());
}
server.start();
InetSocketAddress serverBindAddress = NetUtils.getConnectAddress(server);
this.bindAddress = NetUtils.createSocketAddrForHost(serverBindAddress.getAddress().getCanonicalHostName(), serverBindAddress.getPort());
LOG.info("Instantiated DAGClientRPCServer at " + bindAddress);
} catch (Exception e) {
LOG.error("Failed to start DAGClientServer: ", e);
throw new TezUncheckedException(e);
}
}
Aggregations