diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index 13846532c76..575503f6719 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -1988,15 +1988,20 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { final InetSocketAddress bindAddress, Configuration conf, RpcScheduler scheduler) throws IOException { - this.reservoir = new BoundedByteBufferPool( - conf.getInt("hbase.ipc.server.reservoir.max.buffer.size", 1024 * 1024), - conf.getInt("hbase.ipc.server.reservoir.initial.buffer.size", 16 * 1024), - // Make the max twice the number of handlers to be safe. - conf.getInt("hbase.ipc.server.reservoir.initial.max", - conf.getInt(HConstants.REGION_SERVER_HANDLER_COUNT, - HConstants.DEFAULT_REGION_SERVER_HANDLER_COUNT) * 2), - // By default make direct byte buffers from the buffer pool. - conf.getBoolean("hbase.ipc.server.reservoir.direct.buffer", true)); + + if (conf.getBoolean("hbase.ipc.server.reservoir.enabled", true)) { + this.reservoir = new BoundedByteBufferPool( + conf.getInt("hbase.ipc.server.reservoir.max.buffer.size", 1024 * 1024), + conf.getInt("hbase.ipc.server.reservoir.initial.buffer.size", 16 * 1024), + // Make the max twice the number of handlers to be safe. + conf.getInt("hbase.ipc.server.reservoir.initial.max", + conf.getInt(HConstants.REGION_SERVER_HANDLER_COUNT, + HConstants.DEFAULT_REGION_SERVER_HANDLER_COUNT) * 2), + // By default make direct byte buffers from the buffer pool. + conf.getBoolean("hbase.ipc.server.reservoir.direct.buffer", true)); + } else { + reservoir = null; + } this.server = server; this.services = services; this.bindAddress = bindAddress;