tkhurana commented on code in PR #2138:
URL: https://github.com/apache/phoenix/pull/2138#discussion_r2072043885
##########
phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -472,6 +480,16 @@ public ConnectionQueryServicesImpl(QueryServices services,
ConnectionInfo connec
if (connectionInfo.getPrincipal() != null) {
config.set(QUERY_SERVICES_NAME, connectionInfo.getPrincipal());
}
+
+ if (config.getBoolean(PRINCIPAL_BASED_THREAD_POOL_ENABLED,
DEFAULT_PRINCIPAL_BASED_THREAD_POOL_ENABLED)) {
+ final int keepAlive =
config.getInt(PRINCIPAL_BASED_THREAD_POOL_KEEP_ALIVE_SECONDS,
DEFAULT_PRINCIPAL_BASED_THREAD_POOL_KEEP_ALIVE_SECONDS);
+ final int corePoolSize =
config.getInt(PRINCIPAL_BASED_THREAD_POOL_CORE_POOL_SIZE,
DEFAULT_PRINCIPAL_BASED_THREAD_POOL_CORE_POOL_SIZE);
+ final int maxThreads =
config.getInt(PRINCIPAL_BASED_THREAD_POOL_MAX_THREADS,
DEFAULT_PRINCIPAL_BASED_THREAD_POOL_MAX_THREADS);
+ final int maxQueue =
config.getInt(PRINCIPAL_BASED_THREAD_POOL_MAX_QUEUE,
DEFAULT_PRINCIPAL_BASED_THREAD_POOL_MAX_QUEUE);
+ final String threadPoolName = connectionInfo.getPrincipal() !=
null ? connectionInfo.getPrincipal() : "default";
+ this.threadPoolExecutor = new ThreadPoolExecutor(corePoolSize,
maxThreads, keepAlive, TimeUnit.SECONDS,
Review Comment:
That's also how we set up phoenix client thread pool for scans
https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/job/JobManager.java#L91-L92
--
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]