org.apache.ignite.thread

## Class IgniteStripedThreadPoolExecutor

- java.lang.Object
- - org.apache.ignite.thread.IgniteStripedThreadPoolExecutor

All Implemented Interfaces:
  Executor, ExecutorService

    public class IgniteStripedThreadPoolExecutor
    extends Object
    implements ExecutorService

An `ExecutorService` that executes submitted tasks using pooled grid threads.

### Constructor Summary

Constructors
Constructor and Description
`IgniteStripedThreadPoolExecutor(int concurrentLvl, String gridName, String threadNamePrefix)` Create striped thread pool.

### Method Summary

Methods
`boolean` `awaitTermination(long timeout, TimeUnit unit)`
`void` `execute(Runnable cmd)`
`void` `execute(Runnable task, int idx)` Executes the given command at some time in the future.
`<T> List<Future<T>>` `invokeAll(Collection<? extends Callable<T>> tasks)`
`<T> List<Future<T>>` `invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)`
`<T> T` `invokeAny(Collection<? extends Callable<T>> tasks)`
`<T> T` `invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)`
`boolean` `isShutdown()`
`boolean` `isTerminated()`
`void` `shutdown()`
`List<Runnable>` `shutdownNow()`
`<T> Future<T>` `submit(Callable<T> task)`
`Future<?>` `submit(Runnable task)`
`<T> Future<T>` `submit(Runnable task, T res)`
`int` `threadId(int idx)`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### IgniteStripedThreadPoolExecutor

    public IgniteStripedThreadPoolExecutor(int concurrentLvl,
                                   String gridName,
                                   String threadNamePrefix)

Create striped thread pool.

Parameters:
  `concurrentLvl` - Concurrency level.
  `gridName` - Node name.
  `threadNamePrefix` - Thread name prefix.

### Method Detail

#### execute

    public void execute(Runnable task,
               int idx)

Executes the given command at some time in the future. The command with the same `index` will be executed in the same thread.

Parameters:
  `task` - the runnable task
  `idx` - Striped index.
Throws:
  `RejectedExecutionException` - if this task cannot be accepted for execution.
  `NullPointerException` - If command is null

#### threadId

    public int threadId(int idx)

Parameters:
  `idx` - Index.
Returns:
  Stripped thread ID.

#### shutdown

    public void shutdown()

Specified by:
  `shutdown` in interface `ExecutorService`

#### shutdownNow

    public List<Runnable> shutdownNow()

Specified by:
  `shutdownNow` in interface `ExecutorService`

#### isShutdown

    public boolean isShutdown()

Specified by:
  `isShutdown` in interface `ExecutorService`

#### isTerminated

    public boolean isTerminated()

Specified by:
  `isTerminated` in interface `ExecutorService`

#### awaitTermination

    public boolean awaitTermination(long timeout,
                           TimeUnit unit)
                             throws InterruptedException

Specified by:
  `awaitTermination` in interface `ExecutorService`
Throws:
  `InterruptedException`

#### submit

    @NotNull
    public <T> Future<T> submit(Callable<T> task)

Specified by:
  `submit` in interface `ExecutorService`

#### submit

    @NotNull
    public <T> Future<T> submit(Runnable task,
                               T res)

Specified by:
  `submit` in interface `ExecutorService`

#### submit

    @NotNull
    public Future<?> submit(Runnable task)

Specified by:
  `submit` in interface `ExecutorService`

#### invokeAll

    @NotNull
    public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)

Specified by:
  `invokeAll` in interface `ExecutorService`

#### invokeAll

    @NotNull
    public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
                                        long timeout,
                                        TimeUnit unit)

Specified by:
  `invokeAll` in interface `ExecutorService`

#### invokeAny

    @NotNull
    public <T> T invokeAny(Collection<? extends Callable<T>> tasks)

Specified by:
  `invokeAny` in interface `ExecutorService`

#### invokeAny

    public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
                  long timeout,
                  TimeUnit unit)

Specified by:
  `invokeAny` in interface `ExecutorService`

#### execute

    public void execute(Runnable cmd)

Specified by:
  `execute` in interface `Executor`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017