featzhang commented on code in PR #27568:
URL: https://github.com/apache/flink/pull/27568#discussion_r3121307314


##########
flink-models/flink-model-triton/src/main/java/org/apache/flink/model/triton/TritonUtils.java:
##########
@@ -51,40 +66,148 @@ public class TritonUtils {
 
     private static final Object LOCK = new Object();
 
-    private static final Map<Long, ClientValue> cache = new HashMap<>();
+    private static final Map<ClientKey, ClientValue> cache = new HashMap<>();
+
+    /** Connection pool configuration holder. */
+    public static class ConnectionPoolConfig {

Review Comment:
   ✅ Fixed: Moved ConnectionPoolConfig to its own file 
(ConnectionPoolConfig.java) for better code organization and following Java 
best practices. Updated in commit 3eb6e7b7f1a.



##########
flink-models/flink-model-triton/src/main/java/org/apache/flink/model/triton/TritonOptions.java:
##########
@@ -165,4 +165,89 @@ private TritonOptions() {
                                                     + "Example: %s",
                                             
code("'X-Custom-Header:value,X-Another:value2'"))
                                     .build());
+
+    // ========== Connection Pool Management Options ==========
+
+    public static final ConfigOption<Integer> CONNECTION_POOL_MAX_IDLE =
+            ConfigOptions.key("connection-pool-max-idle")
+                    .intType()
+                    .defaultValue(20)
+                    .withDescription(
+                            Description.builder()
+                                    .text(
+                                            "Maximum number of idle 
connections to keep in the pool. "
+                                                    + "Higher values reduce 
connection setup overhead but consume more memory. "
+                                                    + "Recommended: 10-50 
depending on parallelism and QPS. "
+                                                    + "Defaults to 20.")
+                                    .build());
+
+    public static final ConfigOption<Duration> CONNECTION_POOL_KEEP_ALIVE =
+            ConfigOptions.key("connection-pool-keep-alive")
+                    .durationType()
+                    .defaultValue(Duration.ofSeconds(300))
+                    .withDescription(
+                            Description.builder()
+                                    .text(
+                                            "Duration to keep idle connections 
alive in the pool before eviction. "
+                                                    + "Longer durations reduce 
connection setup overhead but may keep stale connections. "
+                                                    + "Recommended: 60s-600s. "
+                                                    + "Defaults to 300s (5 
minutes).")
+                                    .build());
+
+    public static final ConfigOption<Integer> CONNECTION_POOL_MAX_TOTAL =
+            ConfigOptions.key("connection-pool-max-total")
+                    .intType()
+                    .defaultValue(100)
+                    .withDescription(
+                            Description.builder()
+                                    .text(
+                                            "Maximum total number of 
connections across all routes. "

Review Comment:
   ✅ Fixed: Clarified that "route" means "unique host:port combinations" in the 
documentation. Updated in commit 3eb6e7b7f1a.



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