qqu0127 commented on code in PR #2249:
URL: https://github.com/apache/helix/pull/2249#discussion_r1001339708


##########
meta-client/src/main/java/org/apache/helix/metaclient/factories/MetaClientConfig.java:
##########
@@ -0,0 +1,91 @@
+package org.apache.helix.metaclient.factories;
+
+class MetaClientConfig {
+
+  public enum RetryProtocol {
+    NO_RETRY, EXP_BACK_OFF, CONST_RETRY_INTERVAL
+  }
+
+  public enum StoreType {
+    ZOOKEEPER, ETCD
+  }
+
+  private String _connectionAddress;
+  private long _connectionTimeout;
+  private boolean _enableAuth;
+  private StoreType _storeType;
+
+  public String getConnectionAddress() {
+    return _connectionAddress;
+  }
+
+  public long getConnectionTimeout() {
+    return _connectionTimeout;
+  }
+
+  public boolean isAuthEnabled() {
+    return _enableAuth;
+  }
+  public StoreType getStoreType() {
+    return _storeType;
+  }
+
+  // TODO: More options to add later
+  // private boolean _autoReRegistWatcher;  // re-register one time watcher 
when set to true
+  // private boolean _resetWatchWhenReConnect; // re-register previous 
existing watcher when reconnect
+  // private RetryProtocol _retryProtocol;
+
+  private MetaClientConfig(Builder builder) {
+    _connectionAddress = builder._connectionAddress;
+    _connectionTimeout = builder._connectionTimeout;
+    _enableAuth = builder._enableAuth;
+    _storeType = builder._storeType;
+
+  }

Review Comment:
   For builder pattern, my own understanding is that it separates the 
construction of a complex object from its representation so that the same 
builder can create different representations with little twist. 
   The constructor is still private, and people are only supposed to call 
builder.build(). The difference is the constructor will not depend on the 
builder class. Just my two cents.



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