public final class ClientExecutionServiceImpl extends Object implements ClientExecutionService, MetricsProvider
Modifier and Type | Field and Description |
---|---|
static HazelcastProperty |
INTERNAL_EXECUTOR_POOL_SIZE |
static long |
TERMINATE_TIMEOUT_SECONDS |
Constructor and Description |
---|
ClientExecutionServiceImpl(String name,
ClassLoader classLoader,
HazelcastProperties properties,
int poolSize,
LoggingService loggingService) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable command) |
ExecutorService |
getUserExecutor() |
int |
getUserExecutorQueueSize() |
void |
provideMetrics(MetricsRegistry registry) |
<V> ScheduledFuture<Future<V>> |
schedule(Callable<V> command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ScheduledFuture<?> |
scheduleWithRepetition(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the given
period.
|
void |
shutdown() |
static void |
shutdownExecutor(String name,
ExecutorService executor,
ILogger logger) |
public static final HazelcastProperty INTERNAL_EXECUTOR_POOL_SIZE
public static final long TERMINATE_TIMEOUT_SECONDS
public ClientExecutionServiceImpl(String name, ClassLoader classLoader, HazelcastProperties properties, int poolSize, LoggingService loggingService)
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
TaskScheduler
schedule
in interface TaskScheduler
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterget()
method will return
null
upon completionpublic <V> ScheduledFuture<Future<V>> schedule(Callable<V> command, long delay, TimeUnit unit)
TaskScheduler
schedule
in interface TaskScheduler
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterget()
method will return
<V>
upon completionpublic ScheduledFuture<?> scheduleWithRepetition(Runnable command, long initialDelay, long period, TimeUnit unit)
TaskScheduler
initialDelay
then initialDelay+period
, then
initialDelay + 2 * period
, and so on.
If any execution of this task
takes longer than its period, then subsequent execution will be skipped.scheduleWithRepetition
in interface TaskScheduler
command
- the task to executeinitialDelay
- the time to delay first executionperiod
- the period between successive executionsunit
- the time unit of the initialDelay and period parametersget()
method will throw an
exception upon cancellationpublic ExecutorService getUserExecutor()
getUserExecutor
in interface ClientExecutionService
public int getUserExecutorQueueSize()
public void shutdown()
public static void shutdownExecutor(String name, ExecutorService executor, ILogger logger)
public void provideMetrics(MetricsRegistry registry)
provideMetrics
in interface MetricsProvider
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.