HADOOP-13244. o.a.h.ipc.Server#Server should honor handlerCount when queueSizePerHandler is specified in consturctor. Contributed by Kai Sasaki.
This commit is contained in:
parent
ee55b74fb9
commit
20b13d109a
|
@ -2553,7 +2553,7 @@ public abstract class Server {
|
||||||
this.maxDataLength = conf.getInt(CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,
|
this.maxDataLength = conf.getInt(CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,
|
||||||
CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT);
|
CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT);
|
||||||
if (queueSizePerHandler != -1) {
|
if (queueSizePerHandler != -1) {
|
||||||
this.maxQueueSize = queueSizePerHandler;
|
this.maxQueueSize = handlerCount * queueSizePerHandler;
|
||||||
} else {
|
} else {
|
||||||
this.maxQueueSize = handlerCount * conf.getInt(
|
this.maxQueueSize = handlerCount * conf.getInt(
|
||||||
CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
|
CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
|
||||||
|
|
|
@ -348,6 +348,10 @@ public class TestRPC extends TestRpcBase {
|
||||||
|
|
||||||
assertEquals(3, server.getNumReaders());
|
assertEquals(3, server.getNumReaders());
|
||||||
assertEquals(200, server.getMaxQueueSize());
|
assertEquals(200, server.getMaxQueueSize());
|
||||||
|
|
||||||
|
server = newServerBuilder(conf).setQueueSizePerHandler(10)
|
||||||
|
.setNumHandlers(2).setVerbose(false).build();
|
||||||
|
assertEquals(2 * 10, server.getMaxQueueSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue