Search in sources :

Example 1 with InterDatanodeProtocolServerSideTranslatorPB

use of org.apache.hadoop.hdfs.protocolPB.InterDatanodeProtocolServerSideTranslatorPB in project hadoop by apache.

the class DataNode method initIpcServer.

private void initIpcServer() throws IOException {
    InetSocketAddress ipcAddr = NetUtils.createSocketAddr(getConf().getTrimmed(DFS_DATANODE_IPC_ADDRESS_KEY));
    // Add all the RPC protocols that the Datanode implements    
    RPC.setProtocolEngine(getConf(), ClientDatanodeProtocolPB.class, ProtobufRpcEngine.class);
    ClientDatanodeProtocolServerSideTranslatorPB clientDatanodeProtocolXlator = new ClientDatanodeProtocolServerSideTranslatorPB(this);
    BlockingService service = ClientDatanodeProtocolService.newReflectiveBlockingService(clientDatanodeProtocolXlator);
    ipcServer = new RPC.Builder(getConf()).setProtocol(ClientDatanodeProtocolPB.class).setInstance(service).setBindAddress(ipcAddr.getHostName()).setPort(ipcAddr.getPort()).setNumHandlers(getConf().getInt(DFS_DATANODE_HANDLER_COUNT_KEY, DFS_DATANODE_HANDLER_COUNT_DEFAULT)).setVerbose(false).setSecretManager(blockPoolTokenSecretManager).build();
    ReconfigurationProtocolServerSideTranslatorPB reconfigurationProtocolXlator = new ReconfigurationProtocolServerSideTranslatorPB(this);
    service = ReconfigurationProtocolService.newReflectiveBlockingService(reconfigurationProtocolXlator);
    DFSUtil.addPBProtocol(getConf(), ReconfigurationProtocolPB.class, service, ipcServer);
    InterDatanodeProtocolServerSideTranslatorPB interDatanodeProtocolXlator = new InterDatanodeProtocolServerSideTranslatorPB(this);
    service = InterDatanodeProtocolService.newReflectiveBlockingService(interDatanodeProtocolXlator);
    DFSUtil.addPBProtocol(getConf(), InterDatanodeProtocolPB.class, service, ipcServer);
    TraceAdminProtocolServerSideTranslatorPB traceAdminXlator = new TraceAdminProtocolServerSideTranslatorPB(this);
    BlockingService traceAdminService = TraceAdminService.newReflectiveBlockingService(traceAdminXlator);
    DFSUtil.addPBProtocol(getConf(), TraceAdminProtocolPB.class, traceAdminService, ipcServer);
    LOG.info("Opened IPC server at " + ipcServer.getListenerAddress());
    // set service-level authorization security policy
    if (getConf().getBoolean(CommonConfigurationKeys.HADOOP_SECURITY_AUTHORIZATION, false)) {
        ipcServer.refreshServiceAcl(getConf(), new HDFSPolicyProvider());
    }
}
Also used : ReconfigurationProtocolServerSideTranslatorPB(org.apache.hadoop.hdfs.protocolPB.ReconfigurationProtocolServerSideTranslatorPB) ClientDatanodeProtocolServerSideTranslatorPB(org.apache.hadoop.hdfs.protocolPB.ClientDatanodeProtocolServerSideTranslatorPB) RPC(org.apache.hadoop.ipc.RPC) InterDatanodeProtocolServerSideTranslatorPB(org.apache.hadoop.hdfs.protocolPB.InterDatanodeProtocolServerSideTranslatorPB) HDFSPolicyProvider(org.apache.hadoop.hdfs.HDFSPolicyProvider) InetSocketAddress(java.net.InetSocketAddress) TraceAdminProtocolServerSideTranslatorPB(org.apache.hadoop.tracing.TraceAdminProtocolServerSideTranslatorPB) BlockingService(com.google.protobuf.BlockingService)

Aggregations

BlockingService (com.google.protobuf.BlockingService)1 InetSocketAddress (java.net.InetSocketAddress)1 HDFSPolicyProvider (org.apache.hadoop.hdfs.HDFSPolicyProvider)1 ClientDatanodeProtocolServerSideTranslatorPB (org.apache.hadoop.hdfs.protocolPB.ClientDatanodeProtocolServerSideTranslatorPB)1 InterDatanodeProtocolServerSideTranslatorPB (org.apache.hadoop.hdfs.protocolPB.InterDatanodeProtocolServerSideTranslatorPB)1 ReconfigurationProtocolServerSideTranslatorPB (org.apache.hadoop.hdfs.protocolPB.ReconfigurationProtocolServerSideTranslatorPB)1 RPC (org.apache.hadoop.ipc.RPC)1 TraceAdminProtocolServerSideTranslatorPB (org.apache.hadoop.tracing.TraceAdminProtocolServerSideTranslatorPB)1