Package org.apache.iceberg.util
Class ThreadPools
- java.lang.Object
-
- org.apache.iceberg.util.ThreadPools
-
public class ThreadPools extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
WORKER_THREAD_POOL_SIZE
static java.lang.String
WORKER_THREAD_POOL_SIZE_PROP
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.concurrent.ExecutorService
getWorkerPool()
Return anExecutorService
that uses the "worker" thread-pool.static java.util.concurrent.ScheduledExecutorService
newScheduledPool(java.lang.String namePrefix, int poolSize)
Create a newScheduledExecutorService
with the given name and pool size.static java.util.concurrent.ExecutorService
newWorkerPool(java.lang.String namePrefix)
static java.util.concurrent.ExecutorService
newWorkerPool(java.lang.String namePrefix, int poolSize)
-
-
-
Field Detail
-
WORKER_THREAD_POOL_SIZE_PROP
public static final java.lang.String WORKER_THREAD_POOL_SIZE_PROP
- See Also:
- Constant Field Values
-
WORKER_THREAD_POOL_SIZE
public static final int WORKER_THREAD_POOL_SIZE
-
-
Method Detail
-
getWorkerPool
public static java.util.concurrent.ExecutorService getWorkerPool()
Return anExecutorService
that uses the "worker" thread-pool.The size of the worker pool limits the number of tasks concurrently reading manifests in the base table implementation across all concurrent planning operations.
The size of this thread-pool is controlled by the Java system property
iceberg.worker.num-threads
.- Returns:
- an
ExecutorService
that uses the worker pool
-
newWorkerPool
public static java.util.concurrent.ExecutorService newWorkerPool(java.lang.String namePrefix)
-
newWorkerPool
public static java.util.concurrent.ExecutorService newWorkerPool(java.lang.String namePrefix, int poolSize)
-
newScheduledPool
public static java.util.concurrent.ScheduledExecutorService newScheduledPool(java.lang.String namePrefix, int poolSize)
Create a newScheduledExecutorService
with the given name and pool size.Threads used by this service will be daemon threads.
- Parameters:
namePrefix
- a base name for threads in the executor service's thread poolpoolSize
- max number of threads to use- Returns:
- an executor service
-
-