Class BoundedExecutorService
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.util.concurrent.ForwardingExecutorService
org.apache.bookkeeper.common.util.BoundedExecutorService
- All Implemented Interfaces:
Executor,ExecutorService
public class BoundedExecutorService
extends com.google.common.util.concurrent.ForwardingExecutorService
Implements
ExecutorService and allows limiting the number of tasks to
be scheduled in the thread's queue.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecutorServicedelegate()voidinvokeAll(Collection<? extends Callable<T>> tasks) 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) Future<?><T> Future<T><T> Future<T>Methods inherited from class com.google.common.util.concurrent.ForwardingExecutorService
awaitTermination, isShutdown, isTerminated, shutdown, shutdownNowMethods inherited from class com.google.common.collect.ForwardingObject
toString
-
Constructor Details
-
BoundedExecutorService
-
-
Method Details
-
delegate
- Specified by:
delegatein classcom.google.common.util.concurrent.ForwardingExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Overrides:
invokeAllin classcom.google.common.util.concurrent.ForwardingExecutorService- Throws:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Overrides:
invokeAllin classcom.google.common.util.concurrent.ForwardingExecutorService- Throws:
InterruptedException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
invokeAnyin interfaceExecutorService- Overrides:
invokeAnyin classcom.google.common.util.concurrent.ForwardingExecutorService- Throws:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
invokeAnyin interfaceExecutorService- Overrides:
invokeAnyin classcom.google.common.util.concurrent.ForwardingExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
execute
-
submit
- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classcom.google.common.util.concurrent.ForwardingExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classcom.google.common.util.concurrent.ForwardingExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classcom.google.common.util.concurrent.ForwardingExecutorService
-