Search in sources :

Example 6 with ManagedExecutorService

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());
}
Also used : ManagedExecutorService(com.hazelcast.util.executor.ManagedExecutorService)

Example 7 with ManagedExecutorService

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;
}
Also used : ManagedExecutorService(com.hazelcast.util.executor.ManagedExecutorService) ExecutorConfig(com.hazelcast.config.ExecutorConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig)

Aggregations

ManagedExecutorService (com.hazelcast.util.executor.ManagedExecutorService)7 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)2 ExecutionService (com.hazelcast.spi.ExecutionService)2 Config (com.hazelcast.config.Config)1 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)1 ExecutorConfig (com.hazelcast.config.ExecutorConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 ConnectionManagerDTO (com.hazelcast.internal.management.dto.ConnectionManagerDTO)1 EventServiceDTO (com.hazelcast.internal.management.dto.EventServiceDTO)1 MXBeansDTO (com.hazelcast.internal.management.dto.MXBeansDTO)1 ManagedExecutorDTO (com.hazelcast.internal.management.dto.ManagedExecutorDTO)1 OperationServiceDTO (com.hazelcast.internal.management.dto.OperationServiceDTO)1 PartitionServiceBeanDTO (com.hazelcast.internal.management.dto.PartitionServiceBeanDTO)1 ProxyServiceDTO (com.hazelcast.internal.management.dto.ProxyServiceDTO)1 InternalPartitionService (com.hazelcast.internal.partition.InternalPartitionService)1 AccumulationExecutor (com.hazelcast.map.impl.query.AccumulationExecutor)1 AggregationResultProcessor (com.hazelcast.map.impl.query.AggregationResultProcessor)1 CallerRunsAccumulationExecutor (com.hazelcast.map.impl.query.CallerRunsAccumulationExecutor)1 CallerRunsPartitionScanExecutor (com.hazelcast.map.impl.query.CallerRunsPartitionScanExecutor)1 ParallelAccumulationExecutor (com.hazelcast.map.impl.query.ParallelAccumulationExecutor)1