Package org.apache.iceberg.util
Class ThreadPools
java.lang.Object
org.apache.iceberg.util.ThreadPools
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final String
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorService
Return anExecutorService
that uses the "delete worker" thread-pool.static ExecutorService
Return anExecutorService
that uses the "worker" thread-pool.static ScheduledExecutorService
newScheduledPool
(String namePrefix, int poolSize) Create a newScheduledExecutorService
with the given name and pool size.static ExecutorService
newWorkerPool
(String namePrefix) static ExecutorService
newWorkerPool
(String namePrefix, int poolSize)
-
Field Details
-
WORKER_THREAD_POOL_SIZE_PROP
Deprecated.UseWORKER_THREAD_POOL_SIZE
instead; will be removed in 2.0.0 -
WORKER_THREAD_POOL_SIZE
public static final int WORKER_THREAD_POOL_SIZE -
DELETE_WORKER_THREAD_POOL_SIZE
public static final int DELETE_WORKER_THREAD_POOL_SIZE
-
-
Method Details
-
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
-
getDeleteWorkerPool
Return anExecutorService
that uses the "delete worker" thread-pool.The size of this worker pool limits the number of tasks concurrently reading delete files within a single JVM. If there are multiple threads loading deletes, all of them will share this worker pool by default.
The size of this thread-pool is controlled by the Java system property
iceberg.worker.delete-num-threads
.- Returns:
- an
ExecutorService
that uses the delete worker pool
-
newWorkerPool
-
newWorkerPool
-
newScheduledPool
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
-
WORKER_THREAD_POOL_SIZE
instead; will be removed in 2.0.0