builder.listenerThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.LISTENER).get()); builder.stateTransferThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.STATE_TRANSFER).get()); builder.persistenceThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.PERSISTENCE).get());
builder.listenerThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.LISTENER).get()); builder.stateTransferThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.STATE_TRANSFER).get()); builder.persistenceThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.PERSISTENCE).get());
builder.listenerThreadPool().read(this.listenerThreadPool.getValue()); builder.stateTransferThreadPool().read(this.stateTransferThreadPool.getValue()); builder.persistenceThreadPool().read(this.persistenceThreadPool.getValue());
public static void minimizeThreads(GlobalConfigurationBuilder builder) { BlockingThreadPoolExecutorFactory executorFactoryNoQueue = new BlockingThreadPoolExecutorFactory(NAMED_EXECUTORS_THREADS_NO_QUEUE, 0, 0, NAMED_EXECUTORS_KEEP_ALIVE); BlockingThreadPoolExecutorFactory executorFactoryWithQueue = new BlockingThreadPoolExecutorFactory(NAMED_EXECUTORS_THREADS_WITH_QUEUE, NAMED_EXECUTORS_THREADS_WITH_QUEUE, NAMED_EXECUTORS_QUEUE_SIZE, NAMED_EXECUTORS_KEEP_ALIVE); builder.transport().remoteCommandThreadPool().threadPoolFactory(executorFactoryNoQueue); builder.stateTransferThreadPool().threadPoolFactory(executorFactoryNoQueue); builder.asyncThreadPool().threadPoolFactory(executorFactoryWithQueue); builder.listenerThreadPool().threadPoolFactory(executorFactoryWithQueue); builder.transport().transportThreadPool().threadPoolFactory(executorFactoryWithQueue); // TODO Scheduled thread pools don't have a threads limit // Timeout thread pool is not configurable at all }
case ASYNC_LISTENER_EXECUTOR: { ThreadPoolExecutorFactory executorFactory = createBlockingThreadPoolExecutorFactory(parseExecutor(reader)); holder.getGlobalConfigurationBuilder().listenerThreadPool().threadFactory(threadFactory).threadPoolFactory(executorFactory); break;