use of com.hazelcast.internal.networking.spinning.SpinningIOThreadingModel in project hazelcast by hazelcast.
the class DefaultNodeContext method createTcpIpConnectionThreadingModel.
private IOThreadingModel createTcpIpConnectionThreadingModel(Node node, NodeIOService ioService) {
boolean spinning = Boolean.getBoolean("hazelcast.io.spinning");
LoggingServiceImpl loggingService = node.loggingService;
SocketWriterInitializerImpl socketWriterInitializer = new SocketWriterInitializerImpl(loggingService.getLogger(SocketWriterInitializerImpl.class));
SocketReaderInitializerImpl socketReaderInitializer = new SocketReaderInitializerImpl(loggingService.getLogger(SocketReaderInitializerImpl.class));
if (spinning) {
return new SpinningIOThreadingModel(loggingService, node.getHazelcastThreadGroup(), ioService.getIoOutOfMemoryHandler(), socketWriterInitializer, socketReaderInitializer);
} else {
return new NonBlockingIOThreadingModel(loggingService, node.nodeEngine.getMetricsRegistry(), node.getHazelcastThreadGroup(), ioService.getIoOutOfMemoryHandler(), ioService.getInputSelectorThreadCount(), ioService.getOutputSelectorThreadCount(), ioService.getBalancerIntervalSeconds(), socketWriterInitializer, socketReaderInitializer);
}
}
Aggregations