public class ThreadingOptions extends Object
RejectedExecutionHandler
that throws, such as
ThreadPoolExecutor.AbortPolicy
; a blocking handler could introduce deadlocks.
Netty uses a separate pool for I/O operations, that can be configured via NettyOptions
.Constructor and Description |
---|
ThreadingOptions() |
Modifier and Type | Method and Description |
---|---|
ExecutorService |
createBlockingExecutor(String clusterName)
Builds the executor used to block on new connections before they are added to a pool.
|
ExecutorService |
createExecutor(String clusterName)
Builds the main internal executor, used for tasks such as scheduling speculative executions, triggering
registered
SchemaChangeListener s, reacting to node state changes, and metadata updates. |
ScheduledExecutorService |
createReaperExecutor(String clusterName)
Builds the executor for an internal maintenance task used to clean up closed connections.
|
ScheduledExecutorService |
createReconnectionExecutor(String clusterName)
Builds the executor when reconnection attempts will be scheduled.
|
ScheduledExecutorService |
createScheduledTasksExecutor(String clusterName)
Builds the executor to handle host state notifications from Cassandra.
|
ThreadFactory |
createThreadFactory(String clusterName,
String executorName)
Builds a thread factory for the threads created by a given executor.
|
public ThreadFactory createThreadFactory(String clusterName, String executorName)
clusterName
- the name of the cluster, as specified by
Cluster.Builder.withClusterName(String)
.executorName
- a name that identifies the executor.public ExecutorService createExecutor(String clusterName)
SchemaChangeListener
s, reacting to node state changes, and metadata updates.
The default implementation sets the pool size to the number of available cores.clusterName
- the name of the cluster, as specified by
Cluster.Builder.withClusterName(String)
.public ExecutorService createBlockingExecutor(String clusterName)
clusterName
- the name of the cluster, as specified by
Cluster.Builder.withClusterName(String)
.public ScheduledExecutorService createReconnectionExecutor(String clusterName)
clusterName
- the name of the cluster, as specified by
Cluster.Builder.withClusterName(String)
.public ScheduledExecutorService createScheduledTasksExecutor(String clusterName)
clusterName
- the name of the cluster, as specified by
Cluster.Builder.withClusterName(String)
.public ScheduledExecutorService createReaperExecutor(String clusterName)
clusterName
- the name of the cluster, as specified by
Cluster.Builder.withClusterName(String)
.