public class IgniteStripedThreadPoolExecutor extends Object implements ExecutorService
ExecutorService
that executes submitted tasks using pooled grid threads.Constructor and Description |
---|
IgniteStripedThreadPoolExecutor(int concurrentLvl,
String igniteInstanceName,
String threadNamePrefix,
Thread.UncaughtExceptionHandler eHnd,
boolean allowCoreThreadTimeOut,
long keepAliveTime)
Create striped thread pool.
|
Modifier and Type | Method and Description |
---|---|
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> @NotNull List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks) |
<T> @NotNull 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> @NotNull Future<T> |
submit(Callable<T> task) |
@NotNull Future<?> |
submit(Runnable task) |
<T> @NotNull Future<T> |
submit(Runnable task,
T res) |
int |
threadId(int idx) |
String |
toString() |
public IgniteStripedThreadPoolExecutor(int concurrentLvl, String igniteInstanceName, String threadNamePrefix, Thread.UncaughtExceptionHandler eHnd, boolean allowCoreThreadTimeOut, long keepAliveTime)
concurrentLvl
- Concurrency level.igniteInstanceName
- Node name.threadNamePrefix
- Thread name prefix.allowCoreThreadTimeOut
- Sets the policy governing whether core threads may time out and
terminate if no tasks arrive within the keep-alive time.keepAliveTime
- When the number of threads is greater than the core, this is the maximum time
that excess idle threads will wait for new tasks before terminating.public void execute(Runnable task, int idx)
index
will be executed in the same thread.task
- the runnable taskidx
- Striped index.RejectedExecutionException
- if this task cannot be
accepted for execution.NullPointerException
- If command is nullpublic int threadId(int idx)
idx
- Index.public void shutdown()
shutdown
in interface ExecutorService
public List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
public boolean isShutdown()
isShutdown
in interface ExecutorService
public boolean isTerminated()
isTerminated
in interface ExecutorService
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface ExecutorService
InterruptedException
@NotNull public <T> @NotNull Future<T> submit(Callable<T> task)
submit
in interface ExecutorService
@NotNull public <T> @NotNull Future<T> submit(Runnable task, T res)
submit
in interface ExecutorService
@NotNull public @NotNull Future<?> submit(Runnable task)
submit
in interface ExecutorService
@NotNull public <T> @NotNull List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
invokeAll
in interface ExecutorService
@NotNull public <T> @NotNull List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
invokeAll
in interface ExecutorService
@NotNull public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
invokeAny
in interface ExecutorService
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
invokeAny
in interface ExecutorService
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024