dasahcc commented on a change in pull request #745: Add RealmAwareZkClient and 
RealmAwareZkClientFactory interfaces
URL: https://github.com/apache/helix/pull/745#discussion_r379135620
 
 

 ##########
 File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/RealmAwareZkClient.java
 ##########
 @@ -306,48 +326,63 @@ public int hashCode() {
   }
 
   /**
-   * Configuration for creating a new ZkConnection.
+   * ZkConnection-related configs for creating an instance of 
RealmAwareZkClient.
    */
-  class ZkConnectionConfig {
-    // Connection configs
-    private final String _zkServers;
-    private int _sessionTimeout = HelixZkClient.DEFAULT_SESSION_TIMEOUT;
+  class RealmAwareZkConnectionConfig {
+    /**
+     * mode: Which mode the RealmAwareZkClientConfig should be created in
+     */
+    private final MODE _mode;
+    /**
+     * zkRealmShardingKey: used to deduce which ZK realm this 
RealmAwareZkClientConfig should connect to.
+     * NOTE: this field will be ignored if MODE is MULTI_REALM!
+     */
+    private final String _zkRealmShardingKey;
+    private int _sessionTimeout = DEFAULT_SESSION_TIMEOUT;
 
-    public ZkConnectionConfig(String zkServers) {
-      _zkServers = zkServers;
+    public RealmAwareZkConnectionConfig(MODE mode, String zkRealmShardingKey) {
+      if (mode == null) {
+        throw new ZkClientException("Mode cannot be null!");
+      }
+      _mode = mode;
+      _zkRealmShardingKey = zkRealmShardingKey;
 
 Review comment:
   Seemed to me the connection is per zk realm. Then the routing logic should 
be at Factory layer, right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to