virajjasani commented on code in PR #2252:
URL: https://github.com/apache/phoenix/pull/2252#discussion_r2240956142
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/UncoveredGlobalIndexRegionScanner.java:
##########
@@ -97,10 +124,16 @@ public UncoveredGlobalIndexRegionScanner(final
RegionScanner innerScanner, final
rowCountPerTask =
config.getInt(INDEX_ROW_COUNTS_PER_TASK_CONF_KEY,
DEFAULT_INDEX_ROW_COUNTS_PER_TASK);
- pool = new WaitForCompletionTaskRunner(ThreadPoolManager
- .getExecutor(new ThreadPoolBuilder("Uncovered Global Index",
env.getConfiguration())
- .setMaxThread(NUM_CONCURRENT_INDEX_THREADS_CONF_KEY,
DEFAULT_CONCURRENT_INDEX_THREADS)
- .setCoreTimeout(INDEX_WRITER_KEEP_ALIVE_TIME_CONF_KEY), env));
+ try {
+ pool = getRegionThreadPoolCache().get(region,
+ () -> new WaitForCompletionTaskRunner(ThreadPoolManager
+ .getExecutor(new ThreadPoolBuilder("Uncovered Global Index",
env.getConfiguration())
+ .setMaxThread(NUM_CONCURRENT_INDEX_THREADS_CONF_KEY,
DEFAULT_CONCURRENT_INDEX_THREADS)
Review Comment:
Do we still want to keep 16 as default max threads for uncovered index
performing scan to data table? With this PR, we have opportunity to increase
it? How about 128 or 256?
cc @tkhurana
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/UncoveredGlobalIndexRegionScanner.java:
##########
@@ -97,10 +124,16 @@ public UncoveredGlobalIndexRegionScanner(final
RegionScanner innerScanner, final
rowCountPerTask =
config.getInt(INDEX_ROW_COUNTS_PER_TASK_CONF_KEY,
DEFAULT_INDEX_ROW_COUNTS_PER_TASK);
- pool = new WaitForCompletionTaskRunner(ThreadPoolManager
- .getExecutor(new ThreadPoolBuilder("Uncovered Global Index",
env.getConfiguration())
- .setMaxThread(NUM_CONCURRENT_INDEX_THREADS_CONF_KEY,
DEFAULT_CONCURRENT_INDEX_THREADS)
- .setCoreTimeout(INDEX_WRITER_KEEP_ALIVE_TIME_CONF_KEY), env));
+ try {
+ pool = getRegionThreadPoolCache().get(region,
+ () -> new WaitForCompletionTaskRunner(ThreadPoolManager
+ .getExecutor(new ThreadPoolBuilder("Uncovered Global Index",
env.getConfiguration())
+ .setMaxThread(NUM_CONCURRENT_INDEX_THREADS_CONF_KEY,
DEFAULT_CONCURRENT_INDEX_THREADS)
+ .setCoreTimeout(INDEX_WRITER_KEEP_ALIVE_TIME_CONF_KEY), env)));
+ } catch (ExecutionException e) {
+ throw new IOException("Failed to create thread pool for
UncoveredGlobalIndexRegionScanner",
+ e.getCause());
Review Comment:
Can we keep `e` as is here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]