public TcpIpJoiner(Node node) { super(node); int tryCount = node.getProperties().getInteger(GroupProperty.TCP_JOIN_PORT_TRY_COUNT); if (tryCount <= 0) { throw new IllegalArgumentException( String.format( "%s should be greater than zero! Current value: %d", GroupProperty.TCP_JOIN_PORT_TRY_COUNT, tryCount)); } maxPortTryCount = tryCount; }
public ClientEngineImpl(Node node) { this.logger = node.getLogger(ClientEngine.class); this.node = node; this.serializationService = node.getSerializationService(); this.nodeEngine = node.nodeEngine; this.endpointManager = new ClientEndpointManagerImpl(this, nodeEngine); this.executor = newExecutor(); this.messageTaskFactory = new CompositeMessageTaskFactory(this.nodeEngine); this.clientExceptionFactory = initClientExceptionFactory(); ClientHeartbeatMonitor heartBeatMonitor = new ClientHeartbeatMonitor( endpointManager, this, nodeEngine.getExecutionService(), node.getProperties()); heartBeatMonitor.start(); }
private Executor newExecutor() { final ExecutionService executionService = nodeEngine.getExecutionService(); int coreSize = Runtime.getRuntime().availableProcessors(); int threadCount = node.getProperties().getInteger(GroupProperty.CLIENT_ENGINE_THREAD_COUNT); if (threadCount <= 0) { threadCount = coreSize * THREADS_PER_CORE; } return executionService.register( ExecutionService.CLIENT_EXECUTOR, threadCount, coreSize * EXECUTOR_QUEUE_CAPACITY_PER_CORE, ExecutorType.CONCRETE); }
@Override public int getSocketLingerSeconds() { return node.getProperties().getSeconds(GroupProperty.SOCKET_LINGER_SECONDS); }
@Override public int getBalancerIntervalSeconds() { return node.getProperties().getSeconds(GroupProperty.IO_BALANCER_INTERVAL_SECONDS); }
@Override public int getConnectionMonitorMaxFaults() { return node.getProperties().getInteger(GroupProperty.CONNECTION_MONITOR_MAX_FAULTS); }
@Override public long getConnectionMonitorInterval() { return node.getProperties().getMillis(GroupProperty.CONNECTION_MONITOR_INTERVAL); }
@Override public int getOutputSelectorThreadCount() { return node.getProperties().getInteger(GroupProperty.IO_OUTPUT_THREAD_COUNT); }
@Override public boolean getSocketNoDelay() { return node.getProperties().getBoolean(GroupProperty.SOCKET_NO_DELAY); }
@Override public boolean getSocketKeepAlive() { return node.getProperties().getBoolean(GroupProperty.SOCKET_KEEP_ALIVE); }
@Override public boolean isMemcacheEnabled() { return node.getProperties().getBoolean(GroupProperty.MEMCACHE_ENABLED); }
@Override public int getSocketClientSendBufferSize() { int clientReceiveBuffer = node.getProperties().getInteger(GroupProperty.SOCKET_CLIENT_SEND_BUFFER_SIZE); return clientReceiveBuffer != -1 ? clientReceiveBuffer : getSocketReceiveBufferSize(); }
@Override public boolean isSocketBufferDirect() { return node.getProperties().getBoolean(GroupProperty.SOCKET_BUFFER_DIRECT); }
@Override public int getSocketSendBufferSize() { return node.getProperties().getInteger(GroupProperty.SOCKET_SEND_BUFFER_SIZE); }
@Override public int getSocketReceiveBufferSize() { return node.getProperties().getInteger(GroupProperty.SOCKET_RECEIVE_BUFFER_SIZE); }
@Override public boolean isSocketBindAny() { return node.getProperties().getBoolean(GroupProperty.SOCKET_CLIENT_BIND_ANY); }
@Override public boolean isRestEnabled() { return node.getProperties().getBoolean(GroupProperty.REST_ENABLED); }
public OperationServiceImpl(NodeEngineImpl nodeEngine) { this.nodeEngine = nodeEngine; this.node = nodeEngine.getNode(); this.thisAddress = node.getThisAddress(); this.logger = node.getLogger(OperationService.class); this.serializationService = (InternalSerializationService) nodeEngine.getSerializationService(); this.backpressureRegulator = new BackpressureRegulator( node.getProperties(), node.getLogger(BackpressureRegulator.class)); int coreSize = Runtime.getRuntime().availableProcessors(); boolean reallyMultiCore = coreSize >= CORE_SIZE_CHECK; int concurrencyLevel = reallyMultiCore ? coreSize * CORE_SIZE_FACTOR : CONCURRENCY_LEVEL; this.invocationRegistry = new InvocationRegistry( node.getLogger(OperationServiceImpl.class), backpressureRegulator.newCallIdSequence(), concurrencyLevel); this.invocationMonitor = new InvocationMonitor( nodeEngine, thisAddress, node.getHazelcastThreadGroup(), node.getProperties(), invocationRegistry, node.getLogger(InvocationMonitor.class), serializationService, nodeEngine.getServiceManager()); this.operationBackupHandler = new OperationBackupHandler(this); this.responseHandler = new ResponseHandler( node.getLogger(ResponseHandler.class), node.getSerializationService(), invocationRegistry, nodeEngine); this.asyncResponseHandler = new AsyncResponseHandler( node.getHazelcastThreadGroup(), node.getLogger(AsyncResponseHandler.class), responseHandler, node.getProperties()); this.operationExecutor = new OperationExecutorImpl( node.getProperties(), node.loggingService, thisAddress, new OperationRunnerFactoryImpl(this), node.getHazelcastThreadGroup(), node.getNodeExtension()); this.slowOperationDetector = new SlowOperationDetector( node.loggingService, operationExecutor.getGenericOperationRunners(), operationExecutor.getPartitionOperationRunners(), node.getProperties(), node.getHazelcastThreadGroup()); }
@Override public int getSocketConnectTimeoutSeconds() { return node.getProperties().getSeconds(GroupProperty.SOCKET_CONNECT_TIMEOUT_SECONDS); }