Package org.apache.ignite.thread
Class IgniteStripedThreadPoolExecutor
- java.lang.Object
- 
- org.apache.ignite.thread.IgniteStripedThreadPoolExecutor
 
- 
- All Implemented Interfaces:
- Executor,- ExecutorService,- org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService
 
 public class IgniteStripedThreadPoolExecutor extends Object implements ExecutorService, org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService AnExecutorServicethat executes submitted tasks using pooled grid threads.
- 
- 
Constructor SummaryConstructors Constructor Description IgniteStripedThreadPoolExecutor(int concurrentLvl, String igniteInstanceName, String threadNamePrefix, Thread.UncaughtExceptionHandler eHnd, boolean allowCoreThreadTimeOut, long keepAliveTime)Create striped thread pool.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long timeout, TimeUnit unit)voidexecute(Runnable cmd)voidexecute(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> TinvokeAny(Collection<? extends Callable<T>> tasks)<T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)booleanisShutdown()booleanisTerminated()voidregisterMetrics(org.apache.ignite.internal.processors.metric.MetricRegistryImpl mreg)Register thread pool metrics.voidshutdown()List<Runnable>shutdownNow()@NotNull Future<?>submit(Runnable task)<T> @NotNull Future<T>submit(Runnable task, T res)<T> @NotNull Future<T>submit(Callable<T> task)intthreadId(int idx)StringtoString()
 
- 
- 
- 
Constructor Detail- 
IgniteStripedThreadPoolExecutorpublic IgniteStripedThreadPoolExecutor(int concurrentLvl, String igniteInstanceName, String threadNamePrefix, Thread.UncaughtExceptionHandler eHnd, boolean allowCoreThreadTimeOut, long keepAliveTime)Create striped thread pool.- Parameters:
- 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.
- eHnd- Uncaught exception handler.
 
 
- 
 - 
Method Detail- 
executepublic void execute(Runnable task, int idx) Executes the given command at some time in the future. The command with the sameindexwill 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
 
 - 
threadIdpublic int threadId(int idx) - Parameters:
- idx- Index.
- Returns:
- Stripped thread ID.
 
 - 
shutdownpublic void shutdown() - Specified by:
- shutdownin interface- ExecutorService
 
 - 
shutdownNowpublic List<Runnable> shutdownNow() - Specified by:
- shutdownNowin interface- ExecutorService
 
 - 
isShutdownpublic boolean isShutdown() - Specified by:
- isShutdownin interface- ExecutorService
 
 - 
isTerminatedpublic boolean isTerminated() - Specified by:
- isTerminatedin interface- ExecutorService
 
 - 
awaitTerminationpublic boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException- Specified by:
- awaitTerminationin interface- ExecutorService
- Throws:
- InterruptedException
 
 - 
submit@NotNull public <T> @NotNull Future<T> submit(Callable<T> task) - Specified by:
- submitin interface- ExecutorService
 
 - 
submit@NotNull public <T> @NotNull Future<T> submit(Runnable task, T res) - Specified by:
- submitin interface- ExecutorService
 
 - 
submit@NotNull public @NotNull Future<?> submit(Runnable task) - Specified by:
- submitin interface- ExecutorService
 
 - 
invokeAll@NotNull public <T> @NotNull List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) - Specified by:
- invokeAllin interface- ExecutorService
 
 - 
invokeAll@NotNull public <T> @NotNull List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) - Specified by:
- invokeAllin interface- ExecutorService
 
 - 
invokeAny@NotNull public <T> T invokeAny(Collection<? extends Callable<T>> tasks) - Specified by:
- invokeAnyin interface- ExecutorService
 
 - 
invokeAnypublic <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) - Specified by:
- invokeAnyin interface- ExecutorService
 
 - 
registerMetricspublic void registerMetrics(org.apache.ignite.internal.processors.metric.MetricRegistryImpl mreg) Register thread pool metrics.- Specified by:
- registerMetricsin interface- org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService
- Parameters:
- mreg- Metrics registry.
 
 
- 
 
-