public final class ExecutionServiceImpl extends Object implements InternalExecutionService
ASYNC_EXECUTOR, CLIENT_BLOCKING_EXECUTOR, CLIENT_EXECUTOR, CLIENT_MANAGEMENT_EXECUTOR, CLIENT_QUERY_EXECUTOR, IO_EXECUTOR, MAP_LOAD_ALL_KEYS_EXECUTOR, MAP_LOADER_EXECUTOR, OFFLOADABLE_EXECUTOR, QUERY_EXECUTOR, SCHEDULED_EXECUTOR, SYSTEM_EXECUTOR
Constructor and Description |
---|
ExecutionServiceImpl(NodeEngineImpl nodeEngine) |
public ExecutionServiceImpl(NodeEngineImpl nodeEngine)
public LoggingScheduledExecutor getScheduledExecutorService()
public ManagedExecutorService register(String name, int defaultPoolSize, int defaultQueueCapacity, ExecutorType type)
register
in interface ExecutionService
name
- for the executor servicedefaultPoolSize
- the maximum number of threads to allow in the pooldefaultQueueCapacity
- the queue to use for holding tasks before they are executed.type
- @ExecutorType.CACHED
or @ExecutorType.CONCRETE
public ManagedExecutorService register(String name, int defaultPoolSize, int defaultQueueCapacity, ThreadFactory threadFactory)
ExecutionService
ExecutorType.CONCRETE
type.
The executors with @ExecutorType.CACHED
types can not have custom thread factory since they will share the
threads with other @ExecutorType.CACHED
executors.register
in interface ExecutionService
name
- for the executor servicedefaultPoolSize
- the maximum number of threads to allow in the pooldefaultQueueCapacity
- the queue to use for holding tasks before they are executed.threadFactory
- custom thread factory for the managed executor service.public ManagedExecutorService getExecutor(String name)
getExecutor
in interface ExecutionService
public ManagedExecutorService getDurable(String name)
getDurable
in interface InternalExecutionService
public ExecutorService getScheduledDurable(String name)
getScheduledDurable
in interface InternalExecutionService
public <V> ICompletableFuture<V> asCompletableFuture(Future<V> future)
asCompletableFuture
in interface ExecutionService
public void execute(String name, Runnable command)
execute
in interface ExecutionService
public void executeDurable(String name, Runnable command)
executeDurable
in interface InternalExecutionService
public Future<?> submit(String name, Runnable task)
submit
in interface ExecutionService
public <T> Future<T> submit(String name, Callable<T> task)
submit
in interface ExecutionService
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
schedule
in interface ExecutionService
public ScheduledFuture<?> schedule(String name, Runnable command, long delay, TimeUnit unit)
schedule
in interface ExecutionService
public ScheduledFuture<?> scheduleDurable(String name, Runnable command, long delay, TimeUnit unit)
scheduleDurable
in interface InternalExecutionService
public <V> ScheduledFuture<Future<V>> scheduleDurable(String name, Callable<V> command, long delay, TimeUnit unit)
scheduleDurable
in interface InternalExecutionService
public ScheduledFuture<?> scheduleWithRepetition(Runnable command, long initialDelay, long period, TimeUnit unit)
scheduleWithRepetition
in interface ExecutionService
public ScheduledFuture<?> scheduleWithRepetition(String name, Runnable command, long initialDelay, long period, TimeUnit unit)
scheduleWithRepetition
in interface ExecutionService
public ScheduledFuture<?> scheduleDurableWithRepetition(String name, Runnable command, long initialDelay, long period, TimeUnit unit)
scheduleDurableWithRepetition
in interface InternalExecutionService
public TaskScheduler getGlobalTaskScheduler()
getGlobalTaskScheduler
in interface ExecutionService
public TaskScheduler getTaskScheduler(String name)
getTaskScheduler
in interface ExecutionService
public void shutdown()
public void shutdownExecutor(String name)
shutdownExecutor
in interface ExecutionService
public void shutdownDurableExecutor(String name)
shutdownDurableExecutor
in interface InternalExecutionService
public void shutdownScheduledDurableExecutor(String name)
shutdownScheduledDurableExecutor
in interface InternalExecutionService
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.