jerryshao commented on code in PR #7495:
URL: https://github.com/apache/gravitino/pull/7495#discussion_r2220975270


##########
clients/client-java/src/main/java/org/apache/gravitino/client/HTTPClient.java:
##########
@@ -701,14 +713,48 @@ public static Builder builder(Map<String, String> 
properties) {
     return new Builder(properties);
   }
 
+  private static HttpClientConnectionManager configureConnectionManager(
+      Map<String, String> properties) {
+    PoolingHttpClientConnectionManagerBuilder connectionManagerBuilder =
+        PoolingHttpClientConnectionManagerBuilder.create();
+    ConnectionConfig connectionConfig = configureConnectionConfig(properties);
+    if (connectionConfig != null) {
+      connectionManagerBuilder.setDefaultConnectionConfig(connectionConfig);
+    }
+    return connectionManagerBuilder.build();
+  }
+
+  @VisibleForTesting
+  static ConnectionConfig configureConnectionConfig(Map<String, String> 
properties) {
+    Long connectionTimeoutMillis =
+        MapUtils.propertyAsNullableLong(properties, 
CLIENT_CONNECTION_TIMEOUT_MS);
+    Integer socketTimeoutMillis =
+        MapUtils.propertyAsNullableInt(properties, CLIENT_SOCKET_TIMEOUT_MS);
+
+    if (connectionTimeoutMillis == null && socketTimeoutMillis == null) {
+      return null;
+    }
+
+    ConnectionConfig.Builder connConfigBuilder = ConnectionConfig.custom();
+
+    if (connectionTimeoutMillis != null) {

Review Comment:
   I think we should also check the value itself, like non negative, etc.



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