use of com.hazelcast.logging.LoggingServiceImpl 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);
}
}
use of com.hazelcast.logging.LoggingServiceImpl in project hazelcast by hazelcast.
the class TcpIpConnection_AbstractTest method setup.
@Before
public void setup() throws Exception {
addressA = new Address("127.0.0.1", 5701);
addressB = new Address("127.0.0.1", 5702);
addressC = new Address("127.0.0.1", 5703);
loggingService = new LoggingServiceImpl("somegroup", "log4j2", BuildInfoProvider.BUILD_INFO);
logger = loggingService.getLogger(TcpIpConnection_AbstractTest.class);
metricsRegistryA = newMetricsRegistry();
connManagerA = newConnectionManager(addressA.getPort(), metricsRegistryA);
ioServiceA = (MockIOService) connManagerA.getIoService();
metricsRegistryB = newMetricsRegistry();
connManagerB = newConnectionManager(addressB.getPort(), metricsRegistryB);
ioServiceB = (MockIOService) connManagerB.getIoService();
metricsRegistryC = newMetricsRegistry();
connManagerC = newConnectionManager(addressC.getPort(), metricsRegistryC);
ioServiceC = (MockIOService) connManagerB.getIoService();
serializationService = (InternalSerializationService) new DefaultSerializationServiceBuilder().addDataSerializableFactory(TestDataFactory.FACTORY_ID, new TestDataFactory()).build();
}
use of com.hazelcast.logging.LoggingServiceImpl 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;
}
use of com.hazelcast.logging.LoggingServiceImpl in project hazelcast by hazelcast.
the class OperationExecutorImpl_AbstractTest method setup.
@Before
public void setup() throws Exception {
loggingService = new LoggingServiceImpl("foo", "jdk", new BuildInfo("1", "1", "1", 1, false, (byte) 1));
serializationService = new DefaultSerializationServiceBuilder().build();
config = new Config();
config.setProperty(PARTITION_COUNT.getName(), "10");
config.setProperty(PARTITION_OPERATION_THREAD_COUNT.getName(), "10");
config.setProperty(GENERIC_OPERATION_THREAD_COUNT.getName(), "10");
thisAddress = new Address("localhost", 5701);
threadGroup = new HazelcastThreadGroup("foo", loggingService.getLogger(HazelcastThreadGroup.class), Thread.currentThread().getContextClassLoader());
nodeExtension = new DefaultNodeExtension(Mockito.mock(Node.class));
handlerFactory = new DummyOperationRunnerFactory();
responsePacketHandler = new DummyResponsePacketHandler();
}
use of com.hazelcast.logging.LoggingServiceImpl 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;
}
Aggregations