kfaraz commented on a change in pull request #12298:
URL: https://github.com/apache/druid/pull/12298#discussion_r818268078



##########
File path: 
core/src/main/java/org/apache/druid/java/util/http/client/pool/ResourcePool.java
##########
@@ -177,7 +183,8 @@ private ImmediateCreationResourceHolder(
       this.unusedResourceTimeoutMillis = unusedResourceTimeoutMillis;
       this.resourceHolderList = new ArrayDeque<>();
 
-      for (int i = 0; i < maxSize; ++i) {
+      final int initializationSize = eagerInitialization ? maxSize : 1;
+      for (int i = 0; i < initializationSize; ++i) {

Review comment:
       If `eager` is false, it would create just one connection on start-up.
   Would it ever create more connections or will it always remain at 1?

##########
File path: 
core/src/main/java/org/apache/druid/java/util/http/client/HttpClientConfig.java
##########
@@ -118,6 +121,11 @@ public int getNumConnections()
     return numConnections;
   }
 
+  public boolean isEagerInitialization()
+  {
+    return eagerInitialization;

Review comment:
       Nit: I feel `lazy` is a more commonly used term for such use cases 
rather than `eager`. I would prefer `lazyConnections` rather than 
`eagerInitialization`.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to