Use common thread pool only if it is set by user#1
Conversation
| .setKeepAliveMillSecs(DEFAULT_KEEPALIVE_TIME_MS) | ||
| .setThreadNamePrefix("jedis-multi-node-pipeline") | ||
| .setWorkQueue(new ArrayBlockingQueue<>(DEFAULT_BLOCKING_QUEUE_SIZE)).build(); | ||
| private final ExecutorService executorService = getThreadPool(); |
There was a problem hiding this comment.
We need to define executorService as a static variable to avoid multiple creation and destruction.
| .setCoreSize(DEFAULT_CORE_POOL_SIZE) | ||
| .setMaxSize(DEFAULT_MAXIMUM_POOL_SIZE) | ||
| .setKeepAliveMillSecs(DEFAULT_KEEPALIVE_TIME_MS) | ||
| .setThreadNamePrefix("jedis-multi-node-pipeline") |
There was a problem hiding this comment.
I guess you mean to make it the default thread pool of Jedis, then we need to modify the name to jedis-default-xxx instead of jedis-multi-node-pipeline.
Before, I put it in MultiNodePipeline.java so that it only appears where it is used, and these thread pool parameters are prepared for the jedis-multi-node-pipeline scenario.
| .setCoreSize(DEFAULT_CORE_POOL_SIZE) | ||
| .setMaxSize(DEFAULT_MAXIMUM_POOL_SIZE) | ||
| .setKeepAliveMillSecs(DEFAULT_KEEPALIVE_TIME_MS) | ||
| .setThreadNamePrefix("jedis-multi-node-pipeline") |
There was a problem hiding this comment.
I guess you mean to make it the default thread pool of Jedis, then we need to modify the name to jedis-default-xxx instead of jedis-multi-node-pipeline.
Before, I put it in MultiNodePipeline.java so that it only appears where it is used, and these thread pool parameters are prepared for the jedis-multi-node-pipeline scenario.
087ede6 to
44713b7
Compare
No description provided.