voldemort.server.niosocket
Class NioSocketService
java.lang.Object
voldemort.server.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
| 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)
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
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao