public class StripedExecutor extends Object implements ExecutorService
| Modifier and Type | Class and Description |
|---|---|
static class |
StripedExecutor.Stripe
Stripe.
|
| Constructor and Description |
|---|
StripedExecutor(int cnt,
String igniteInstanceName,
String poolName,
IgniteLogger log,
IgniteInClosure<Throwable> errHnd,
boolean stealTasks,
GridWorkerListener gridWorkerLsnr,
long failureDetectionTimeout) |
StripedExecutor(int cnt,
String igniteInstanceName,
String poolName,
IgniteLogger log,
IgniteInClosure<Throwable> errHnd,
GridWorkerListener gridWorkerLsnr,
long failureDetectionTimeout) |
| Modifier and Type | Method and Description |
|---|---|
int |
activeStripesCount() |
void |
awaitComplete(int... stripes)
Method for await all task completion in some specific striped indexes or all.
|
boolean |
awaitTermination(long timeout,
@NotNull TimeUnit unit) |
long |
completedTasks() |
boolean |
detectStarvation()
Checks starvation in striped pool.
|
void |
execute(int idx,
Runnable cmd)
Execute command.
|
void |
execute(@NotNull Runnable cmd) |
<T> @NotNull List<Future<T>> |
invokeAll(@NotNull Collection<? extends Callable<T>> tasks)
Operation not supported.
|
<T> @NotNull List<Future<T>> |
invokeAll(@NotNull Collection<? extends Callable<T>> tasks,
long timeout,
@NotNull TimeUnit unit)
Operation not supported.
|
<T> T |
invokeAny(@NotNull Collection<? extends Callable<T>> tasks)
Operation not supported.
|
<T> T |
invokeAny(@NotNull Collection<? extends Callable<T>> tasks,
long timeout,
@NotNull TimeUnit unit)
Operation not supported.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
int |
queueSize() |
int |
queueStripeSize(int idx) |
void |
shutdown() |
@NotNull List<Runnable> |
shutdownNow() |
void |
stop()
Stops executor.
|
StripedExecutor.Stripe[] |
stripes() |
boolean[] |
stripesActiveStatuses() |
long[] |
stripesCompletedTasks() |
int |
stripesCount() |
int[] |
stripesQueueSizes() |
<T> @NotNull Future<T> |
submit(@NotNull Callable<T> task)
Operation not supported.
|
@NotNull Future<?> |
submit(@NotNull Runnable task)
Operation not supported.
|
<T> @NotNull Future<T> |
submit(@NotNull Runnable task,
T res)
Operation not supported.
|
String |
toString() |
public StripedExecutor(int cnt,
String igniteInstanceName,
String poolName,
IgniteLogger log,
IgniteInClosure<Throwable> errHnd,
GridWorkerListener gridWorkerLsnr,
long failureDetectionTimeout)
cnt - Count.igniteInstanceName - Node name.poolName - Pool name.log - Logger.errHnd - Critical failure handler.gridWorkerLsnr - Listener to link with every stripe worker.public StripedExecutor(int cnt,
String igniteInstanceName,
String poolName,
IgniteLogger log,
IgniteInClosure<Throwable> errHnd,
boolean stealTasks,
GridWorkerListener gridWorkerLsnr,
long failureDetectionTimeout)
cnt - Count.igniteInstanceName - Node name.poolName - Pool name.log - Logger.errHnd - Critical failure handler.stealTasks - True to steal tasks.gridWorkerLsnr - listener to link with every stripe worker.public boolean detectStarvation()
public int stripesCount()
public StripedExecutor.Stripe[] stripes()
public void execute(int idx,
Runnable cmd)
idx - Index.cmd - Command.public void shutdown()
shutdown in interface ExecutorServicepublic void execute(@NotNull
@NotNull Runnable cmd)
@NotNull public @NotNull List<Runnable> shutdownNow()
shutdownNow in interface ExecutorServicepublic boolean awaitTermination(long timeout,
@NotNull
@NotNull TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceInterruptedExceptionpublic boolean isShutdown()
isShutdown in interface ExecutorServicepublic boolean isTerminated()
isTerminated in interface ExecutorServicepublic void stop()
public int queueSize()
public int queueStripeSize(int idx)
idx - Stripe index.public long completedTasks()
public long[] stripesCompletedTasks()
public boolean[] stripesActiveStatuses()
public int activeStripesCount()
public int[] stripesQueueSizes()
@NotNull public <T> @NotNull Future<T> submit(@NotNull @NotNull Runnable task, T res)
submit in interface ExecutorService@NotNull public @NotNull Future<?> submit(@NotNull @NotNull Runnable task)
submit in interface ExecutorService@NotNull public <T> @NotNull Future<T> submit(@NotNull @NotNull Callable<T> task)
submit in interface ExecutorService@NotNull public <T> @NotNull List<Future<T>> invokeAll(@NotNull @NotNull Collection<? extends Callable<T>> tasks) throws InterruptedException
invokeAll in interface ExecutorServiceInterruptedException@NotNull public <T> @NotNull List<Future<T>> invokeAll(@NotNull @NotNull Collection<? extends Callable<T>> tasks, long timeout, @NotNull @NotNull TimeUnit unit) throws InterruptedException
invokeAll in interface ExecutorServiceInterruptedException@NotNull
public <T> T invokeAny(@NotNull
@NotNull Collection<? extends Callable<T>> tasks)
throws InterruptedException,
ExecutionException
invokeAny in interface ExecutorServiceInterruptedExceptionExecutionExceptionpublic <T> T invokeAny(@NotNull
@NotNull Collection<? extends Callable<T>> tasks,
long timeout,
@NotNull
@NotNull TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
invokeAny in interface ExecutorServiceInterruptedExceptionExecutionExceptionTimeoutExceptionpublic void awaitComplete(int... stripes)
throws InterruptedException
stripes - Striped idxs for await. Empty params means await all stripes.InterruptedException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.1 Release Date : December 9 2020