Search in sources :

Example 11 with LoggingService

use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.

the class SelectWithSelectorFix_NioNetworkingFactory method create.

@Override
public NioNetworking create(final MockServerContext serverContext, MetricsRegistry metricsRegistry) {
    HazelcastProperties properties = serverContext.properties();
    LoggingService loggingService = serverContext.loggingService;
    return new NioNetworking(new NioNetworking.Context().loggingService(loggingService).metricsRegistry(metricsRegistry).threadNamePrefix(serverContext.getHazelcastName()).errorHandler(new TcpServerConnectionChannelErrorHandler(loggingService.getLogger(TcpServerConnectionChannelErrorHandler.class))).inputThreadCount(properties.getInteger(IO_INPUT_THREAD_COUNT)).outputThreadCount(properties.getInteger(IO_OUTPUT_THREAD_COUNT)).balancerIntervalSeconds(properties.getInteger(IO_BALANCER_INTERVAL_SECONDS)).selectorMode(SelectorMode.SELECT_WITH_FIX).selectorWorkaroundTest(true));
}
Also used : MockServerContext(com.hazelcast.internal.server.MockServerContext) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) TcpServerConnectionChannelErrorHandler(com.hazelcast.internal.server.tcp.TcpServerConnectionChannelErrorHandler) LoggingService(com.hazelcast.logging.LoggingService)

Example 12 with LoggingService

use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.

the class TaskletExecutionServiceTest method before.

@Before
public void before() {
    executor = Executors.newCachedThreadPool();
    NodeEngineImpl neMock = mock(NodeEngineImpl.class);
    HazelcastInstance hzMock = mock(HazelcastInstance.class);
    when(neMock.getHazelcastInstance()).thenReturn(hzMock);
    when(hzMock.getName()).thenReturn("test-hz-instance");
    ExecutionService es = mock(ExecutionService.class);
    when(neMock.getExecutionService()).thenReturn(es);
    when(es.submit(eq(TASKLET_INIT_CLOSE_EXECUTOR_NAME), any(Runnable.class))).then(invocationOnMock -> executor.submit(invocationOnMock.<Runnable>getArgument(1)));
    LoggingService loggingService = mock(LoggingService.class);
    when(neMock.getLoggingService()).thenReturn(loggingService);
    when(loggingService.getLogger(TaskletExecutionService.class)).thenReturn(Logger.getLogger(TaskletExecutionService.class));
    MetricsRegistryImpl metricsRegistry = new MetricsRegistryImpl(mock(ILogger.class), ProbeLevel.INFO);
    when(neMock.getMetricsRegistry()).thenReturn(metricsRegistry);
    HazelcastProperties properties = new HazelcastProperties(new Properties());
    tes = new TaskletExecutionService(neMock, THREAD_COUNT, properties);
    classLoaderMock = mock(ClassLoader.class);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) HazelcastInstance(com.hazelcast.core.HazelcastInstance) LoggingService(com.hazelcast.logging.LoggingService) MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) ILogger(com.hazelcast.logging.ILogger) ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService) Properties(java.util.Properties) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Before(org.junit.Before)

Aggregations

LoggingService (com.hazelcast.logging.LoggingService)12 ILogger (com.hazelcast.logging.ILogger)4 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)4 HazelcastInstance (com.hazelcast.core.HazelcastInstance)3 TcpServerConnectionChannelErrorHandler (com.hazelcast.internal.server.tcp.TcpServerConnectionChannelErrorHandler)3 Before (org.junit.Before)3 ClientAwsConfig (com.hazelcast.client.config.ClientAwsConfig)2 Address (com.hazelcast.nio.Address)2 AWSClient (com.hazelcast.aws.AWSClient)1 AddressTranslator (com.hazelcast.client.connection.AddressTranslator)1 ClientConnectionManagerImpl (com.hazelcast.client.connection.nio.ClientConnectionManagerImpl)1 AwsAddressTranslator (com.hazelcast.client.spi.impl.AwsAddressTranslator)1 DefaultAddressTranslator (com.hazelcast.client.spi.impl.DefaultAddressTranslator)1 DiscoveryAddressTranslator (com.hazelcast.client.spi.impl.discovery.DiscoveryAddressTranslator)1 HazelcastThreadGroup (com.hazelcast.instance.HazelcastThreadGroup)1 Node (com.hazelcast.instance.Node)1 MetricsRegistry (com.hazelcast.internal.metrics.MetricsRegistry)1 MetricsRegistryImpl (com.hazelcast.internal.metrics.impl.MetricsRegistryImpl)1 IOThreadingModel (com.hazelcast.internal.networking.IOThreadingModel)1 MockServerContext (com.hazelcast.internal.server.MockServerContext)1