voldemort.server.niosocket
Class NioSocketService
java.lang.Object
voldemort.common.service.AbstractService
voldemort.server.AbstractSocketService
voldemort.server.niosocket.NioSocketService
- All Implemented Interfaces:
- VoldemortService
public class NioSocketService
- extends AbstractSocketService
NioSocketService is an NIO-based socket service, comparable to the
blocking-IO-based socket service.
The NIO server is enabled in the server.properties file by setting the
"enable.nio.connector" property to "true". If you want to adjust the number
of SelectorManager instances that are used, change "nio.connector.selectors"
to a positive integer value. Otherwise, the number of selectors will be equal
to the number of CPUs visible to the JVM.
This code uses the NIO APIs directly. It would be a good idea to consider
some of the NIO frameworks to handle this more cleanly, efficiently, and to
handle corner cases.
- See Also:
SocketService
Constructor Summary |
NioSocketService(RequestHandlerFactory requestHandlerFactory,
int port,
int socketBufferSize,
int selectors,
java.lang.String serviceName,
boolean enableJmx,
int acceptorBacklog)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NioSocketService
public NioSocketService(RequestHandlerFactory requestHandlerFactory,
int port,
int socketBufferSize,
int selectors,
java.lang.String serviceName,
boolean enableJmx,
int acceptorBacklog)
getStatusManager
public StatusManager getStatusManager()
- Description copied from class:
AbstractSocketService
- Returns a StatusManager instance for use with status reporting tools.
- Specified by:
getStatusManager
in class AbstractSocketService
- Returns:
- StatusManager
startInner
protected void startInner()
- Specified by:
startInner
in class AbstractService
stopInner
protected void stopInner()
- Specified by:
stopInner
in class AbstractService
getNumActiveConnections
public final int getNumActiveConnections()
getNumQueuedConnections
public final int getNumQueuedConnections()
getSelectCountAvg
public final double getSelectCountAvg()
getSelectCount99th
public final double getSelectCount99th()
getSelectTimeMsAvg
public final double getSelectTimeMsAvg()
getSelectTimeMs99th
public final double getSelectTimeMs99th()
getProcessingTimeMsAvg
public final double getProcessingTimeMsAvg()
getprocessingTimeMs99th
public final double getprocessingTimeMs99th()
getCommReadBufferSize
public final double getCommReadBufferSize()
getCommWriteBufferSize
public final double getCommWriteBufferSize()
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu