public class ThreadPools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DELETE_WORKER_THREAD_POOL_SIZE |
static int |
WORKER_THREAD_POOL_SIZE |
static java.lang.String |
WORKER_THREAD_POOL_SIZE_PROP
Deprecated.
Use
WORKER_THREAD_POOL_SIZE instead;
will be removed in 2.0.0 |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.ExecutorService |
getDeleteWorkerPool()
Return an
ExecutorService that uses the "delete worker" thread-pool. |
static java.util.concurrent.ExecutorService |
getWorkerPool()
Return an
ExecutorService that uses the "worker" thread-pool. |
static java.util.concurrent.ScheduledExecutorService |
newScheduledPool(java.lang.String namePrefix,
int poolSize)
Create a new
ScheduledExecutorService 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) |
@Deprecated public static final java.lang.String WORKER_THREAD_POOL_SIZE_PROP
WORKER_THREAD_POOL_SIZE
instead;
will be removed in 2.0.0public static final int WORKER_THREAD_POOL_SIZE
public static final int DELETE_WORKER_THREAD_POOL_SIZE
public static java.util.concurrent.ExecutorService getWorkerPool()
ExecutorService
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
.
ExecutorService
that uses the worker poolpublic static java.util.concurrent.ExecutorService getDeleteWorkerPool()
ExecutorService
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
.
ExecutorService
that uses the delete worker poolpublic static java.util.concurrent.ExecutorService newWorkerPool(java.lang.String namePrefix)
public static java.util.concurrent.ExecutorService newWorkerPool(java.lang.String namePrefix, int poolSize)
public static java.util.concurrent.ScheduledExecutorService newScheduledPool(java.lang.String namePrefix, int poolSize)
ScheduledExecutorService
with the given name and pool size.
Threads used by this service will be daemon threads.
namePrefix
- a base name for threads in the executor service's thread poolpoolSize
- max number of threads to use