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


##########
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;
+    }

Review Comment:
   I think this check is not necessary. if None of these two configs are set, 
we can return an empty `connConfigBuilder`, no need to return null.



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