Search in sources :

Example 1 with SocketReaderInitializerImpl

use of com.hazelcast.nio.tcp.SocketReaderInitializerImpl 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)

Example 2 with SocketReaderInitializerImpl

use of com.hazelcast.nio.tcp.SocketReaderInitializerImpl in project hazelcast by hazelcast.

the class SelectNow_NonBlockingIOThreadingModelFactory method create.

@Override
public NonBlockingIOThreadingModel create(MockIOService ioService, MetricsRegistry metricsRegistry) {
    LoggingServiceImpl loggingService = ioService.loggingService;
    NonBlockingIOThreadingModel threadingModel = new NonBlockingIOThreadingModel(loggingService, metricsRegistry, ioService.hazelcastThreadGroup, ioService.getIoOutOfMemoryHandler(), ioService.getInputSelectorThreadCount(), ioService.getOutputSelectorThreadCount(), ioService.getBalancerIntervalSeconds(), new SocketWriterInitializerImpl(loggingService.getLogger(SocketWriterInitializerImpl.class)), new SocketReaderInitializerImpl(loggingService.getLogger(SocketReaderInitializerImpl.class)));
    threadingModel.setSelectorMode(SelectorMode.SELECT_NOW);
    return threadingModel;
}
Also used : SocketReaderInitializerImpl(com.hazelcast.nio.tcp.SocketReaderInitializerImpl) LoggingServiceImpl(com.hazelcast.logging.LoggingServiceImpl) SocketWriterInitializerImpl(com.hazelcast.nio.tcp.SocketWriterInitializerImpl)

Example 3 with SocketReaderInitializerImpl

use of com.hazelcast.nio.tcp.SocketReaderInitializerImpl in project hazelcast by hazelcast.

the class SelectWithSelectorFix_NonBlockingIOThreadingModelFactory method create.

@Override
public NonBlockingIOThreadingModel create(MockIOService ioService, MetricsRegistry metricsRegistry) {
    LoggingServiceImpl loggingService = ioService.loggingService;
    NonBlockingIOThreadingModel threadingModel = new NonBlockingIOThreadingModel(loggingService, metricsRegistry, ioService.hazelcastThreadGroup, ioService.getIoOutOfMemoryHandler(), ioService.getInputSelectorThreadCount(), ioService.getOutputSelectorThreadCount(), ioService.getBalancerIntervalSeconds(), new SocketWriterInitializerImpl(loggingService.getLogger(SocketWriterInitializerImpl.class)), new SocketReaderInitializerImpl(loggingService.getLogger(SocketReaderInitializerImpl.class)));
    threadingModel.setSelectorMode(SelectorMode.SELECT_WITH_FIX);
    threadingModel.setSelectorWorkaroundTest(true);
    return threadingModel;
}
Also used : SocketReaderInitializerImpl(com.hazelcast.nio.tcp.SocketReaderInitializerImpl) LoggingServiceImpl(com.hazelcast.logging.LoggingServiceImpl) SocketWriterInitializerImpl(com.hazelcast.nio.tcp.SocketWriterInitializerImpl)

Example 4 with SocketReaderInitializerImpl

use of com.hazelcast.nio.tcp.SocketReaderInitializerImpl in project hazelcast by hazelcast.

the class Select_NonBlockingIOThreadingModelFactory method create.

@Override
public NonBlockingIOThreadingModel create(MockIOService ioService, MetricsRegistry metricsRegistry) {
    LoggingService loggingService = ioService.loggingService;
    NonBlockingIOThreadingModel threadingModel = new NonBlockingIOThreadingModel(loggingService, metricsRegistry, ioService.hazelcastThreadGroup, ioService.getIoOutOfMemoryHandler(), ioService.getInputSelectorThreadCount(), ioService.getOutputSelectorThreadCount(), ioService.getBalancerIntervalSeconds(), new SocketWriterInitializerImpl(loggingService.getLogger(SocketWriterInitializerImpl.class)), new SocketReaderInitializerImpl(loggingService.getLogger(SocketReaderInitializerImpl.class)));
    threadingModel.setSelectorMode(SelectorMode.SELECT);
    return threadingModel;
}
Also used : SocketReaderInitializerImpl(com.hazelcast.nio.tcp.SocketReaderInitializerImpl) LoggingService(com.hazelcast.logging.LoggingService) SocketWriterInitializerImpl(com.hazelcast.nio.tcp.SocketWriterInitializerImpl)

Aggregations

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