tkhurana commented on code in PR #2138:
URL: https://github.com/apache/phoenix/pull/2138#discussion_r2072042696


##########
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:
   We should set the core and max to the same value because scale up only 
happens when the queue is full but if the queue is big then we never reach that 
limit and we stay at core size.



-- 
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]

Reply via email to