ctubbsii commented on a change in pull request #1059: Switch to thrift server
with multiple selector threads.
URL: https://github.com/apache/accumulo/pull/1059#discussion_r269780815
##########
File path:
server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
##########
@@ -186,7 +187,43 @@ public static ServerAddress startServer(ServerContext
service, String hostname,
}
/**
- * Create a NonBlockingServer with a custom thread pool that can dynamically
resize itself.
+ * Create a non blocking server with multiple select threads and a custom
thread pool that can
+ * dynamically resize itself.
+ */
+ public static ServerAddress createThreadedSelectorServer(HostAndPort address,
+ TProcessor processor, TProtocolFactory protocolFactory, final String
serverName,
+ final int numThreads, final int numSTThreads, long
timeBetweenThreadChecks,
+ long maxMessageSize) throws TTransportException {
+
+ final TNonblockingServerSocket transport = new TNonblockingServerSocket(
+ new InetSocketAddress(address.getHost(), address.getPort()));
+
+ TThreadedSelectorServer.Args options = new
TThreadedSelectorServer.Args(transport);
+
+ options.selectorThreads = Math.max(2,
Runtime.getRuntime().availableProcessors() / 4);
Review comment:
Could make this tunable in future.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services