Search in sources :

Example 1 with LoggingServiceImpl

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);
    }
}
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 LoggingServiceImpl

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();
}
Also used : DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) SocketAddress(java.net.SocketAddress) Address(com.hazelcast.nio.Address) LoggingServiceImpl(com.hazelcast.logging.LoggingServiceImpl) Before(org.junit.Before)

Example 3 with LoggingServiceImpl

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

Example 4 with LoggingServiceImpl

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();
}
Also used : DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) DefaultNodeExtension(com.hazelcast.instance.DefaultNodeExtension) Address(com.hazelcast.nio.Address) LoggingServiceImpl(com.hazelcast.logging.LoggingServiceImpl) Config(com.hazelcast.config.Config) BuildInfo(com.hazelcast.instance.BuildInfo) HazelcastThreadGroup(com.hazelcast.instance.HazelcastThreadGroup) Before(org.junit.Before)

Example 5 with LoggingServiceImpl

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

Aggregations

LoggingServiceImpl (com.hazelcast.logging.LoggingServiceImpl)5 SocketReaderInitializerImpl (com.hazelcast.nio.tcp.SocketReaderInitializerImpl)3 SocketWriterInitializerImpl (com.hazelcast.nio.tcp.SocketWriterInitializerImpl)3 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)2 Address (com.hazelcast.nio.Address)2 Before (org.junit.Before)2 Config (com.hazelcast.config.Config)1 BuildInfo (com.hazelcast.instance.BuildInfo)1 DefaultNodeExtension (com.hazelcast.instance.DefaultNodeExtension)1 HazelcastThreadGroup (com.hazelcast.instance.HazelcastThreadGroup)1 NonBlockingIOThreadingModel (com.hazelcast.internal.networking.nonblocking.NonBlockingIOThreadingModel)1 SpinningIOThreadingModel (com.hazelcast.internal.networking.spinning.SpinningIOThreadingModel)1 SocketAddress (java.net.SocketAddress)1