protected NioNetworking initNetworking(HazelcastClientInstanceImpl client) { HazelcastProperties properties = client.getProperties(); SSLConfig sslConfig = client.getClientConfig().getNetworkConfig().getSSLConfig(); boolean sslEnabled = sslConfig != null && sslConfig.isEnabled(); int configuredInputThreads = properties.getInteger(IO_INPUT_THREAD_COUNT); int configuredOutputThreads = properties.getInteger(IO_OUTPUT_THREAD_COUNT); int inputThreads; if (configuredInputThreads == -1) { inputThreads = sslEnabled ? DEFAULT_SSL_THREAD_COUNT : 1; } else { inputThreads = configuredInputThreads; } int outputThreads; if (configuredOutputThreads == -1) { outputThreads = sslEnabled ? DEFAULT_SSL_THREAD_COUNT : 1; } else { outputThreads = configuredOutputThreads; } return new NioNetworking( new NioNetworking.Context() .loggingService(client.getLoggingService()) .metricsRegistry(client.getMetricsRegistry()) .threadNamePrefix(client.getName()) .errorHandler(new ClientConnectionChannelErrorHandler()) .inputThreadCount(inputThreads) .outputThreadCount(outputThreads) .balancerIntervalSeconds(properties.getInteger(IO_BALANCER_INTERVAL_SECONDS)) .channelInitializer(client.getClientExtension().createChannelInitializer())); }
protected NioNetworking initNetworking(HazelcastClientInstanceImpl client) { HazelcastProperties properties = client.getProperties(); SSLConfig sslConfig = client.getClientConfig().getNetworkConfig().getSSLConfig(); boolean sslEnabled = sslConfig != null && sslConfig.isEnabled(); int configuredInputThreads = properties.getInteger(IO_INPUT_THREAD_COUNT); int configuredOutputThreads = properties.getInteger(IO_OUTPUT_THREAD_COUNT); int inputThreads; if (configuredInputThreads == -1) { inputThreads = sslEnabled ? DEFAULT_SSL_THREAD_COUNT : 1; } else { inputThreads = configuredInputThreads; } int outputThreads; if (configuredOutputThreads == -1) { outputThreads = sslEnabled ? DEFAULT_SSL_THREAD_COUNT : 1; } else { outputThreads = configuredOutputThreads; } return new NioNetworking( new NioNetworking.Context() .loggingService(client.getLoggingService()) .metricsRegistry(client.getMetricsRegistry()) .threadNamePrefix(client.getName()) .errorHandler(new ClientConnectionChannelErrorHandler()) .inputThreadCount(inputThreads) .outputThreadCount(outputThreads) .balancerIntervalSeconds(properties.getInteger(IO_BALANCER_INTERVAL_SECONDS)) .channelInitializer(client.getClientExtension().createChannelInitializer())); }
private Networking createNetworking(Node node, NodeIOService ioService) { ChannelInitializer initializer = node.getNodeExtension().createChannelInitializer(ioService); LoggingServiceImpl loggingService = node.loggingService; ChannelErrorHandler errorHandler = new TcpIpConnectionChannelErrorHandler(loggingService.getLogger(TcpIpConnectionChannelErrorHandler.class)); HazelcastProperties props = node.getProperties(); return new NioNetworking( new NioNetworking.Context() .loggingService(loggingService) .metricsRegistry(node.nodeEngine.getMetricsRegistry()) .threadNamePrefix(node.hazelcastInstance.getName()) .errorHandler(errorHandler) .inputThreadCount(props.getInteger(IO_INPUT_THREAD_COUNT)) .outputThreadCount(props.getInteger(IO_OUTPUT_THREAD_COUNT)) .balancerIntervalSeconds(props.getInteger(IO_BALANCER_INTERVAL_SECONDS)) .channelInitializer(initializer)); } }
private Networking createNetworking(Node node, NodeIOService ioService) { ChannelInitializer initializer = node.getNodeExtension().createChannelInitializer(ioService); LoggingServiceImpl loggingService = node.loggingService; ChannelErrorHandler errorHandler = new TcpIpConnectionChannelErrorHandler(loggingService.getLogger(TcpIpConnectionChannelErrorHandler.class)); HazelcastProperties props = node.getProperties(); return new NioNetworking( new NioNetworking.Context() .loggingService(loggingService) .metricsRegistry(node.nodeEngine.getMetricsRegistry()) .threadNamePrefix(node.hazelcastInstance.getName()) .errorHandler(errorHandler) .inputThreadCount(props.getInteger(IO_INPUT_THREAD_COUNT)) .outputThreadCount(props.getInteger(IO_OUTPUT_THREAD_COUNT)) .balancerIntervalSeconds(props.getInteger(IO_BALANCER_INTERVAL_SECONDS)) .channelInitializer(initializer)); } }