You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/11/23 07:33:40 UTC

[GitHub] [helix] xyuanlu commented on a diff in pull request #2291: Add Meta client factory and ZkMetaClient constructor

xyuanlu commented on code in PR #2291:
URL: https://github.com/apache/helix/pull/2291#discussion_r1030105405


##########
meta-client/src/main/java/org/apache/helix/metaclient/factories/MetaClientConfig.java:
##########
@@ -56,56 +69,81 @@ public StoreType getStoreType() {
   //  private RetryProtocol _retryProtocol;
 
 
-  private MetaClientConfig(String connectionAddress, long connectionTimeout, boolean enableAuth,
-      StoreType storeType) {
+  protected MetaClientConfig(String connectionAddress, long connectionInitTimeout,
+      long sessionTimeout, boolean enableAuth, StoreType storeType) {
     _connectionAddress = connectionAddress;
-    _connectionTimeout = connectionTimeout;
+    _connectionInitTimeout = connectionInitTimeout;
+    _sessionTimeout = sessionTimeout;
     _enableAuth = enableAuth;
     _storeType = storeType;
   }
 
-  public static class Builder {
-    private String _connectionAddress;
-
-    private long _connectionTimeout;
-    private boolean _enableAuth;
-    //private RetryProtocol _retryProtocol;
-    private StoreType _storeType;
+  public static class MetaClientConfigBuilder<B extends MetaClientConfigBuilder<B>> {

Review Comment:
   If we are not using generics with builder, calling setter function defined in base class will returns a bace class object instead.
   
   ```
   ZkMetaClientConfigBuilder.setAuthEnabled(true).setZkSerializer(serializer)
   ```
   will throw exception. 
   
   https://stackoverflow.com/questions/17164375/subclassing-a-java-builder-class



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org