com.hazelcast.spi

## Interface ExecutionService

-     public interface ExecutionService

  A Service responsible for providing access to 'system' executors and customer executors. It also has functionality for scheduling tasks.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ASYNC_EXECUTOR` Name of the async executor.
    `static String` | `CLIENT_BLOCKING_EXECUTOR` Name of the client transaction executor.
    `static String` | `CLIENT_EXECUTOR` Name of the client executor.
    `static String` | `CLIENT_MANAGEMENT_EXECUTOR` Name of the client management executor.
    `static String` | `CLIENT_QUERY_EXECUTOR` Name of the client executor.
    `static String` | `IO_EXECUTOR` Name of the io executor.
    `static String` | `MAP_LOAD_ALL_KEYS_EXECUTOR` The name of the executor that loads the entry keys and dispatches the keys to the partition owners for value loading.
    `static String` | `MAP_LOADER_EXECUTOR` Name of the map-loader executor that loads the entry values for a given key set locally on the member owning the partition which contains the keys.
    `static String` | `OFFLOADABLE_EXECUTOR` Name of the offloadable executor.
    `static String` | `QUERY_EXECUTOR` Name of the query executor.
    `static String` | `SCHEDULED_EXECUTOR` Name of the scheduled executor.
    `static String` | `SYSTEM_EXECUTOR` Name of the system executor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<V> ICompletableFuture<V>` | `asCompletableFuture(Future<V> future)`
    `void` | `execute(String name, Runnable command)`
    `ManagedExecutorService` | `getExecutor(String name)`
    `TaskScheduler` | `getGlobalTaskScheduler()`
    `TaskScheduler` | `getTaskScheduler(String name)`
    `ManagedExecutorService` | `register(String name, int poolSize, int queueCapacity, ExecutorType type)`
    `ManagedExecutorService` | `register(String name, int poolSize, int queueCapacity, ThreadFactory threadFactory)` This register method creates the executor only on @`ExecutorType.CONCRETE` type.
    `ScheduledFuture<?>` | `schedule(Runnable command, long delay, TimeUnit unit)`
    `ScheduledFuture<?>` | `schedule(String name, Runnable command, long delay, TimeUnit unit)`
    `ScheduledFuture<?>` | `scheduleWithRepetition(Runnable command, long initialDelay, long period, TimeUnit unit)`
    `ScheduledFuture<?>` | `scheduleWithRepetition(String name, Runnable command, long initialDelay, long period, TimeUnit unit)`
    `void` | `shutdownExecutor(String name)`
    `<T> Future<T>` | `submit(String name, Callable<T> task)`
    `Future<?>` | `submit(String name, Runnable task)`

- - ### Field Detail

    - #### SYSTEM_EXECUTOR

          static final String SYSTEM_EXECUTOR

      Name of the system executor.
      See Also:
        Constant Field Values

    - #### ASYNC_EXECUTOR

          static final String ASYNC_EXECUTOR

      Name of the async executor.
      See Also:
        Constant Field Values

    - #### SCHEDULED_EXECUTOR

          static final String SCHEDULED_EXECUTOR

      Name of the scheduled executor.
      See Also:
        Constant Field Values

    - #### CLIENT_EXECUTOR

          static final String CLIENT_EXECUTOR

      Name of the client executor.
      See Also:
        Constant Field Values

    - #### CLIENT_QUERY_EXECUTOR

          static final String CLIENT_QUERY_EXECUTOR

      Name of the client executor.
      See Also:
        Constant Field Values

    - #### CLIENT_MANAGEMENT_EXECUTOR

          static final String CLIENT_MANAGEMENT_EXECUTOR

      Name of the client management executor.
      See Also:
        Constant Field Values

    - #### CLIENT_BLOCKING_EXECUTOR

          static final String CLIENT_BLOCKING_EXECUTOR

      Name of the client transaction executor.
      See Also:
        Constant Field Values

    - #### QUERY_EXECUTOR

          static final String QUERY_EXECUTOR

      Name of the query executor.
      See Also:
        Constant Field Values

    - #### IO_EXECUTOR

          static final String IO_EXECUTOR

      Name of the io executor.
      See Also:
        Constant Field Values

    - #### OFFLOADABLE_EXECUTOR

          static final String OFFLOADABLE_EXECUTOR

      Name of the offloadable executor.
      See Also:
        Constant Field Values

    - #### MAP_LOADER_EXECUTOR

          static final String MAP_LOADER_EXECUTOR

      Name of the map-loader executor that loads the entry values for a given key set locally on the member owning the partition which contains the keys. This is the executor you want to configure when you want to load more data from the database in parallel.
      See Also:
        `MapLoader.loadAll(java.util.Collection)`, Constant Field Values

    - #### MAP_LOAD_ALL_KEYS_EXECUTOR

          static final String MAP_LOAD_ALL_KEYS_EXECUTOR

      The name of the executor that loads the entry keys and dispatches the keys to the partition owners for value loading.
      See Also:
        `MapLoader.loadAllKeys()`, Constant Field Values

  - ### Method Detail

    - #### register

          ManagedExecutorService register(String name,
                                          int poolSize,
                                          int queueCapacity,
                                          ExecutorType type)

      Parameters:
        `name` - for the executor service
        `poolSize` - the maximum number of threads to allow in the pool
        `queueCapacity` - the queue to use for holding tasks before they are executed.
        `type` - @`ExecutorType.CACHED` or @`ExecutorType.CONCRETE`
      Returns:
        the created managed executor service

    - #### register

          ManagedExecutorService register(String name,
                                          int poolSize,
                                          int queueCapacity,
                                          ThreadFactory threadFactory)

      This register method creates the executor only on @`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.
      Parameters:
        `name` - for the executor service
        `poolSize` - the maximum number of threads to allow in the pool
        `queueCapacity` - the queue to use for holding tasks before they are executed.
        `threadFactory` - custom thread factory for the managed executor service.
      Returns:
        managed executor service

    - #### getExecutor

          ManagedExecutorService getExecutor(String name)

    - #### shutdownExecutor

          void shutdownExecutor(String name)

    - #### execute

          void execute(String name,
                       Runnable command)

    - #### submit

          Future<?> submit(String name,
                           Runnable task)

    - #### submit

          <T> Future<T> submit(String name,
                               Callable<T> task)

    - #### schedule

          ScheduledFuture<?> schedule(Runnable command,
                                      long delay,
                                      TimeUnit unit)

    - #### schedule

          ScheduledFuture<?> schedule(String name,
                                      Runnable command,
                                      long delay,
                                      TimeUnit unit)

    - #### scheduleWithRepetition

          ScheduledFuture<?> scheduleWithRepetition(Runnable command,
                                                    long initialDelay,
                                                    long period,
                                                    TimeUnit unit)

    - #### scheduleWithRepetition

          ScheduledFuture<?> scheduleWithRepetition(String name,
                                                    Runnable command,
                                                    long initialDelay,
                                                    long period,
                                                    TimeUnit unit)

    - #### getGlobalTaskScheduler

          TaskScheduler getGlobalTaskScheduler()

    - #### getTaskScheduler

          TaskScheduler getTaskScheduler(String name)

    - #### asCompletableFuture

          <V> ICompletableFuture<V> asCompletableFuture(Future<V> future)

Copyright © 2019. All rights reserved.