public class ExecutorServiceFuturePool
extends java.lang.Object
com.twitter:util-core_2.11
ExecutorServiceFuturePool designed to avoid depending on that Scala library.
One problem with using a Scala library is that many downstream projects
(eg Apache Spark) use Scala, and they might want to use a different version of Scala
from the version that Hadoop chooses to use.| Constructor | Description |
|---|---|
ExecutorServiceFuturePool(java.util.concurrent.ExecutorService executor) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.concurrent.Future<java.lang.Void> |
executeFunction(java.util.function.Supplier<java.lang.Void> f) |
|
java.util.concurrent.Future<java.lang.Void> |
executeRunnable(java.lang.Runnable r) |
|
void |
shutdown(org.slf4j.Logger logger,
long timeout,
java.util.concurrent.TimeUnit unit) |
Utility to shutdown the
ExecutorService used by this class. |
java.lang.String |
toString() |
public ExecutorServiceFuturePool(java.util.concurrent.ExecutorService executor)
public java.util.concurrent.Future<java.lang.Void> executeFunction(java.util.function.Supplier<java.lang.Void> f)
f - function to run in future on executor pooljava.util.concurrent.RejectedExecutionException - can be thrownjava.lang.NullPointerException - if f param is nullpublic java.util.concurrent.Future<java.lang.Void> executeRunnable(java.lang.Runnable r)
r - runnable to run in future on executor pooljava.util.concurrent.RejectedExecutionException - can be thrownjava.lang.NullPointerException - if r param is nullpublic void shutdown(org.slf4j.Logger logger,
long timeout,
java.util.concurrent.TimeUnit unit)
ExecutorService used by this class. Will wait up to a
certain timeout for the ExecutorService to gracefully shutdown.logger - Loggertimeout - the maximum time to waitunit - the time unit of the timeout argumentpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.