Search in sources :

Example 1 with DAGClientAMProtocolBlockingPBServerImpl

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);
    }
}
Also used : DAGClientAMProtocolBlockingPB(org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB) Configuration(org.apache.hadoop.conf.Configuration) TezConfiguration(org.apache.tez.dag.api.TezConfiguration) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException) TezAMPolicyProvider(org.apache.tez.dag.app.security.authorize.TezAMPolicyProvider) InetSocketAddress(java.net.InetSocketAddress) BlockingService(com.google.protobuf.BlockingService) DAGClientAMProtocolBlockingPBServerImpl(org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPBServerImpl) IOException(java.io.IOException) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException)

Aggregations

BlockingService (com.google.protobuf.BlockingService)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 Configuration (org.apache.hadoop.conf.Configuration)1 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)1 TezUncheckedException (org.apache.tez.dag.api.TezUncheckedException)1 DAGClientAMProtocolBlockingPB (org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB)1 DAGClientAMProtocolBlockingPBServerImpl (org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPBServerImpl)1 TezAMPolicyProvider (org.apache.tez.dag.app.security.authorize.TezAMPolicyProvider)1