use of com.hazelcast.internal.networking.IOThreadingModel in project hazelcast by hazelcast.
the class DefaultNodeContext method createConnectionManager.
@Override
public ConnectionManager createConnectionManager(Node node, ServerSocketChannel serverSocketChannel) {
NodeIOService ioService = new NodeIOService(node, node.nodeEngine);
IOThreadingModel ioThreadingModel = createTcpIpConnectionThreadingModel(node, ioService);
return new TcpIpConnectionManager(ioService, serverSocketChannel, node.loggingService, node.nodeEngine.getMetricsRegistry(), ioThreadingModel);
}
use of com.hazelcast.internal.networking.IOThreadingModel 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");
}
Aggregations