use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class AwsAddressTranslatorTest method setUp.
@Before
public void setUp() throws Exception {
privateAddress = new Address("127.0.0.1", 5701);
publicAddress = new Address("192.168.0.1", 5701);
awsClient = mock(AWSClient.class);
when(awsClient.getAddresses()).thenReturn(lookup);
config = new ClientAwsConfig();
config.setIamRole("anyRole");
ILogger logger = Logger.getLogger(AwsAddressTranslatorTest.class);
loggingService = mock(LoggingService.class);
when(loggingService.getLogger(eq(AwsAddressTranslator.class))).thenReturn(logger);
translator = new AwsAddressTranslator(config, loggingService);
}
use of com.hazelcast.logging.LoggingService 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;
}
use of com.hazelcast.logging.LoggingService in project hazelcast-simulator by hazelcast.
the class NetworkTest method setup.
@Setup
public void setup() throws Exception {
Node node = HazelcastTestUtils.getNode(targetInstance);
if (node == null) {
throw new IllegalStateException("node is null");
}
MetricsRegistry metricsRegistry = node.nodeEngine.getMetricsRegistry();
LoggingService loggingService = node.loggingService;
HazelcastThreadGroup threadGroup = node.getHazelcastThreadGroup();
// we don't know the number of worker threads (damn hidden property), so lets assume 1000.. that should be enough
packetHandler = new RequestPacketHandler(1000);
Address thisAddress = node.getThisAddress();
Address newThisAddress = new Address(thisAddress.getHost(), thisAddress.getPort() + PORT_OFFSET);
logger.info("ThisAddress: " + newThisAddress);
MockIOService ioService = new MockIOService(newThisAddress, loggingService);
ioService.inputThreadCount = inputThreadCount;
ioService.outputThreadCount = outputThreadCount;
ioService.socketNoDelay = socketNoDelay;
ioService.packetHandler = packetHandler;
ioService.socketSendBufferSize = socketSendBufferSize;
ioService.socketReceiveBufferSize = socketReceiveBufferSize;
if (trackSequenceId) {
ioService.writeHandlerFactory = new TaggingWriteHandlerFactory();
}
IOThreadingModel threadingModel = null;
switch(ioThreadingModel) {
// break;
default:
throw new IllegalStateException("Unrecognized threading model: " + ioThreadingModel);
}
//
// connectionManager = new TcpIpConnectionManager(
// ioService, ioService.serverSocketChannel, loggingService, metricsRegistry, threadingModel);
// connectionManager.start();
// networkCreateLock = targetInstance.getLock("connectionCreateLock");
}
use of com.hazelcast.logging.LoggingService in project hazelcast-jet by hazelcast.
the class TaskletExecutionServiceTest method before.
@Before
public void before() {
HazelcastInstance hzMock = mock(HazelcastInstance.class);
LoggingService loggingService = mock(LoggingService.class);
Mockito.when(hzMock.getName()).thenReturn("test-hz-instance");
Mockito.when(hzMock.getLoggingService()).thenReturn(loggingService);
Mockito.when(loggingService.getLogger(TaskletExecutionService.class)).thenReturn(Logger.getLogger(TaskletExecutionService.class));
es = new TaskletExecutionService(hzMock, THREAD_COUNT);
classLoaderMock = mock(ClassLoader.class);
}
use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class ProcessorWrapper method initContext.
protected Context initContext(Context context) {
// and also other objects could be mocked or null, such as hazelcastInstance())
if (context instanceof ProcCtx) {
ProcCtx c = (ProcCtx) context;
LoggingService loggingService = c.hazelcastInstance().getLoggingService();
String prefix = prefix(c.jobConfig().getName(), c.jobId(), c.vertexName(), c.globalProcessorIndex());
ILogger newLogger = prefixedLogger(loggingService.getLogger(wrapped.getClass()), prefix);
context = new ProcCtx(c.nodeEngine(), c.jobId(), c.executionId(), c.jobConfig(), newLogger, c.vertexName(), c.localProcessorIndex(), c.globalProcessorIndex(), c.isLightJob(), c.partitionAssignment(), c.localParallelism(), c.memberIndex(), c.memberCount(), c.tempDirectories(), c.serializationService(), c.subject(), c.classLoader());
}
return context;
}
Aggregations