|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cassandra.concurrent.AIOExecutorService
public class AIOExecutorService
Constructor Summary | |
---|---|
AIOExecutorService(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory)
|
Method Summary | ||
---|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first. |
|
void |
execute(java.lang.Runnable command)
Executes the given command at some time in the future. |
|
|
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
Executes the given tasks, returning a list of Futures holding their status and results when all complete. |
|
|
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first. |
|
|
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do. |
|
|
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do before the given timeout elapses. |
|
boolean |
isShutdown()
Returns true if this executor has been shut down. |
|
boolean |
isTerminated()
Returns true if all tasks have completed following shut down. |
|
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. |
|
java.util.List<java.lang.Runnable> |
shutdownNow()
Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution. |
|
|
submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution and returns a Future representing the pending results of the task. |
|
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task)
Submits a Runnable task for execution and returns a Future representing that task. |
|
|
submit(java.lang.Runnable task,
T result)
Submits a Runnable task for execution and returns a Future representing that task. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AIOExecutorService(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.concurrent.ThreadFactory threadFactory)
Method Detail |
---|
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
command
- the runnable task
java.util.concurrent.RejectedExecutionException
- if this task cannot be
accepted for execution.
java.lang.NullPointerException
- if command is nullpublic void shutdown()
This method does not wait for previously submitted tasks to
complete execution. Use awaitTermination
to do that.
shutdown
in interface java.util.concurrent.ExecutorService
java.lang.SecurityException
- if a security manager exists and
shutting down this ExecutorService may manipulate
threads that the caller is not permitted to modify
because it does not hold RuntimePermission
("modifyThread"),
or the security manager's checkAccess method
denies access.public java.util.List<java.lang.Runnable> shutdownNow()
This method does not wait for actively executing tasks to
terminate. Use awaitTermination
to
do that.
There are no guarantees beyond best-effort attempts to stop
processing actively executing tasks. For example, typical
implementations will cancel via Thread.interrupt()
, so any
task that fails to respond to interrupts may never terminate.
shutdownNow
in interface java.util.concurrent.ExecutorService
java.lang.SecurityException
- if a security manager exists and
shutting down this ExecutorService may manipulate
threads that the caller is not permitted to modify
because it does not hold RuntimePermission
("modifyThread"),
or the security manager's checkAccess method
denies access.public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
awaitTermination
in interface java.util.concurrent.ExecutorService
timeout
- the maximum time to waitunit
- the time unit of the timeout argument
java.lang.InterruptedException
- if interrupted while waitingpublic <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
If you would like to immediately block waiting for a task, you can use constructions of the form result = exec.submit(aCallable).get();
Note: The Executors
class includes a set of methods
that can convert some other common closure-like objects,
for example, PrivilegedAction
to
Callable
form so they can be submitted.
submit
in interface java.util.concurrent.ExecutorService
task
- the task to submit
java.util.concurrent.RejectedExecutionException
- if the task cannot be
scheduled for execution
java.lang.NullPointerException
- if the task is nullpublic <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
submit
in interface java.util.concurrent.ExecutorService
task
- the task to submitresult
- the result to return
java.util.concurrent.RejectedExecutionException
- if the task cannot be
scheduled for execution
java.lang.NullPointerException
- if the task is nullpublic java.util.concurrent.Future<?> submit(java.lang.Runnable task)
submit
in interface java.util.concurrent.ExecutorService
task
- the task to submit
java.util.concurrent.RejectedExecutionException
- if the task cannot be
scheduled for execution
java.lang.NullPointerException
- if the task is nullpublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException
Future.isDone()
is true for each
element of the returned list.
Note that a completed task could have
terminated either normally or by throwing an exception.
The results of this method are undefined if the given
collection is modified while this operation is in progress.
invokeAll
in interface java.util.concurrent.ExecutorService
tasks
- the collection of tasks
java.lang.InterruptedException
- if interrupted while waiting, in
which case unfinished tasks are cancelled.
java.lang.NullPointerException
- if tasks or any of its elements are null
java.util.concurrent.RejectedExecutionException
- if any task cannot be
scheduled for executionpublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Future.isDone()
is true for each
element of the returned list.
Upon return, tasks that have not completed are cancelled.
Note that a completed task could have
terminated either normally or by throwing an exception.
The results of this method are undefined if the given
collection is modified while this operation is in progress.
invokeAll
in interface java.util.concurrent.ExecutorService
tasks
- the collection of taskstimeout
- the maximum time to waitunit
- the time unit of the timeout argument
java.lang.InterruptedException
- if interrupted while waiting, in
which case unfinished tasks are cancelled
java.lang.NullPointerException
- if tasks, any of its elements, or
unit are null
java.util.concurrent.RejectedExecutionException
- if any task cannot be scheduled
for executionpublic <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
invokeAny
in interface java.util.concurrent.ExecutorService
tasks
- the collection of tasks
java.lang.InterruptedException
- if interrupted while waiting
java.lang.NullPointerException
- if tasks or any of its elements
are null
java.lang.IllegalArgumentException
- if tasks is empty
java.util.concurrent.ExecutionException
- if no task successfully completes
java.util.concurrent.RejectedExecutionException
- if tasks cannot be scheduled
for executionpublic <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
invokeAny
in interface java.util.concurrent.ExecutorService
tasks
- the collection of taskstimeout
- the maximum time to waitunit
- the time unit of the timeout argument
java.lang.InterruptedException
- if interrupted while waiting
java.lang.NullPointerException
- if tasks, any of its elements, or
unit are null
java.util.concurrent.TimeoutException
- if the given timeout elapses before
any task successfully completes
java.util.concurrent.ExecutionException
- if no task successfully completes
java.util.concurrent.RejectedExecutionException
- if tasks cannot be scheduled
for execution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |