voldemort.server.niosocket
Class NioSocketService

java.lang.Object
  extended by voldemort.common.service.AbstractService
      extended by voldemort.server.AbstractSocketService
          extended by 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

Field Summary
 
Fields inherited from class voldemort.server.AbstractSocketService
enableJmx, port, serviceName
 
Constructor Summary
NioSocketService(RequestHandlerFactory requestHandlerFactory, int port, int socketBufferSize, int selectors, java.lang.String serviceName, boolean enableJmx, int acceptorBacklog)
           
 
Method Summary
 double getCommReadBufferSize()
           
 double getCommWriteBufferSize()
           
 int getNumActiveConnections()
           
 int getNumQueuedConnections()
           
 double getprocessingTimeMs99th()
           
 double getProcessingTimeMsAvg()
           
 double getSelectCount99th()
           
 double getSelectCountAvg()
           
 double getSelectTimeMs99th()
           
 double getSelectTimeMsAvg()
           
 StatusManager getStatusManager()
          Returns a StatusManager instance for use with status reporting tools.
protected  void startInner()
           
protected  void stopInner()
           
 
Methods inherited from class voldemort.server.AbstractSocketService
enableJmx, getPort
 
Methods inherited from class voldemort.common.service.AbstractService
getType, isStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface voldemort.common.service.VoldemortService
getType, isStarted, start, stop
 

Constructor Detail

NioSocketService

public NioSocketService(RequestHandlerFactory requestHandlerFactory,
                        int port,
                        int socketBufferSize,
                        int selectors,
                        java.lang.String serviceName,
                        boolean enableJmx,
                        int acceptorBacklog)
Method Detail

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