use of com.hazelcast.util.executor.ManagedExecutorService in project hazelcast by hazelcast.
the class OperationServiceImpl method initInvocationContext.
private void initInvocationContext() {
ManagedExecutorService asyncExecutor = nodeEngine.getExecutionService().register(ExecutionService.ASYNC_EXECUTOR, Runtime.getRuntime().availableProcessors(), ASYNC_QUEUE_CAPACITY, ExecutorType.CONCRETE);
this.invocationContext = new Invocation.Context(asyncExecutor, nodeEngine.getClusterService().getClusterClock(), nodeEngine.getClusterService(), node.connectionManager, node.nodeEngine.getExecutionService(), nodeEngine.getProperties().getMillis(OPERATION_CALL_TIMEOUT_MILLIS), invocationRegistry, invocationMonitor, nodeEngine.getLogger(Invocation.class), node, nodeEngine, nodeEngine.getPartitionService(), this, operationExecutor, retryCount, serializationService, nodeEngine.getThisAddress());
}
use of com.hazelcast.util.executor.ManagedExecutorService in project hazelcast by hazelcast.
the class ExecutionServiceImpl method register.
@Override
public ManagedExecutorService register(String name, int defaultPoolSize, int defaultQueueCapacity, ExecutorType type) {
ExecutorConfig config = nodeEngine.getConfig().getExecutorConfigs().get(name);
int poolSize = defaultPoolSize;
int queueCapacity = defaultQueueCapacity;
if (config != null) {
poolSize = config.getPoolSize();
if (config.getQueueCapacity() <= 0) {
queueCapacity = Integer.MAX_VALUE;
} else {
queueCapacity = config.getQueueCapacity();
}
}
ManagedExecutorService executor = createExecutor(name, poolSize, queueCapacity, type);
if (executors.putIfAbsent(name, executor) != null) {
throw new IllegalArgumentException("ExecutorService['" + name + "'] already exists!");
}
metricsRegistry.scanAndRegister(executor, "executor.[" + name + "]");
return executor;
}
Aggregations