Example usage for org.apache.hadoop.fs CommonConfigurationKeys IPC_SERVER_RPC_READ_THREADS_DEFAULT

List of usage examples for org.apache.hadoop.fs CommonConfigurationKeys IPC_SERVER_RPC_READ_THREADS_DEFAULT

Introduction

In this page you can find the example usage for org.apache.hadoop.fs CommonConfigurationKeys IPC_SERVER_RPC_READ_THREADS_DEFAULT.

Prototype

int IPC_SERVER_RPC_READ_THREADS_DEFAULT

To view the source code for org.apache.hadoop.fs CommonConfigurationKeys IPC_SERVER_RPC_READ_THREADS_DEFAULT.

Click Source Link

Document

Default value for IPC_SERVER_RPC_READ_THREADS_KEY

Usage

From source file:rpc.TestRPC.java

License:Apache License

@Test
public void testConfRpc() throws IOException {
    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class).setInstance(new TestImpl())
            .setBindAddress(ADDRESS).setPort(0).setNumHandlers(1).setVerbose(false).build();
    // Just one handler
    int confQ = conf.getInt(CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
            CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT);
    assertEquals(confQ, server.getMaxQueueSize());

    int confReaders = conf.getInt(CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_KEY,
            CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_DEFAULT);
    assertEquals(confReaders, server.getNumReaders());
    server.stop();/*from  w  ww  .j  a v a  2  s  .c  o  m*/

    server = new RPC.Builder(conf).setProtocol(TestProtocol.class).setInstance(new TestImpl())
            .setBindAddress(ADDRESS).setPort(0).setNumHandlers(1).setnumReaders(3).setQueueSizePerHandler(200)
            .setVerbose(false).build();

    assertEquals(3, server.getNumReaders());
    assertEquals(200, server.getMaxQueueSize());
    server.stop();
}