Search in sources :

Example 1 with SpinningIOThreadingModel

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);
    }
}
Also used : SpinningIOThreadingModel(com.hazelcast.internal.networking.spinning.SpinningIOThreadingModel) SocketReaderInitializerImpl(com.hazelcast.nio.tcp.SocketReaderInitializerImpl) LoggingServiceImpl(com.hazelcast.logging.LoggingServiceImpl) SocketWriterInitializerImpl(com.hazelcast.nio.tcp.SocketWriterInitializerImpl) NonBlockingIOThreadingModel(com.hazelcast.internal.networking.nonblocking.NonBlockingIOThreadingModel)

Aggregations

NonBlockingIOThreadingModel (com.hazelcast.internal.networking.nonblocking.NonBlockingIOThreadingModel)1 SpinningIOThreadingModel (com.hazelcast.internal.networking.spinning.SpinningIOThreadingModel)1 LoggingServiceImpl (com.hazelcast.logging.LoggingServiceImpl)1 SocketReaderInitializerImpl (com.hazelcast.nio.tcp.SocketReaderInitializerImpl)1 SocketWriterInitializerImpl (com.hazelcast.nio.tcp.SocketWriterInitializerImpl)1