Package alluxio.util.executor
Class ExecutorServiceFactories
- java.lang.Object
-
- alluxio.util.executor.ExecutorServiceFactories
-
public final class ExecutorServiceFactories extends java.lang.Object
Convenience methods for constructing instances ofExecutorServiceFactory
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorServiceFactory
cachedThreadPool(java.lang.String name)
Returns aExecutorServiceFactory
which creates threadpool executors with the given base name.static ExecutorServiceFactory
constantExecutorServiceFactory(java.util.concurrent.ExecutorService executorService)
static ExecutorServiceFactory
fixedThreadPool(java.lang.String name, int nThreads)
Returns aExecutorServiceFactory
which creates threadpool executors with the given base name and number of threads.static ExecutorServiceFactory
fixedThreadPoolExecutorServiceFactory(java.lang.String name, int nThreads)
Returns aExecutorServiceFactory
which creates threadpool executors with the given base name and number of threads.
-
-
-
Method Detail
-
fixedThreadPoolExecutorServiceFactory
public static ExecutorServiceFactory fixedThreadPoolExecutorServiceFactory(java.lang.String name, int nThreads)
Returns aExecutorServiceFactory
which creates threadpool executors with the given base name and number of threads. Created threads will be daemonic.- Parameters:
name
- the base name for executor thread namesnThreads
- the number of threads to create executors with- Returns:
- the
ExecutorServiceFactory
-
cachedThreadPool
public static ExecutorServiceFactory cachedThreadPool(java.lang.String name)
Returns aExecutorServiceFactory
which creates threadpool executors with the given base name. Created threads will be daemonic.- Parameters:
name
- the base name for executor thread names- Returns:
- the
ExecutorServiceFactory
-
fixedThreadPool
public static ExecutorServiceFactory fixedThreadPool(java.lang.String name, int nThreads)
Returns aExecutorServiceFactory
which creates threadpool executors with the given base name and number of threads. Created threads will be daemonic.- Parameters:
name
- the base name for executor thread namesnThreads
- the number of threads to create executors with- Returns:
- the
ExecutorServiceFactory
-
constantExecutorServiceFactory
public static ExecutorServiceFactory constantExecutorServiceFactory(java.util.concurrent.ExecutorService executorService)
- Parameters:
executorService
- the executor service to supply- Returns:
- an
ExecutorServiceFactory
which always returns the givenExecutorService
-
-