xyuanlu commented on code in PR #2291:
URL: https://github.com/apache/helix/pull/2291#discussion_r1038893126
##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClient.java:
##########
@@ -31,15 +31,21 @@
import org.apache.helix.metaclient.api.DirectChildSubscribeResult;
import org.apache.helix.metaclient.api.MetaClientInterface;
import org.apache.helix.metaclient.api.OpResult;
-import org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
+import org.apache.helix.metaclient.impl.zk.factory.ZkMetaClientConfig;
+import org.apache.helix.zookeeper.impl.client.ZkClient;
+import org.apache.helix.zookeeper.zkclient.ZkConnection;
public class ZkMetaClient implements MetaClientInterface {
- private RealmAwareZkClient _zkClient;
-
- public ZkMetaClient() {
+ private final ZkClient _zkClient;
+ public ZkMetaClient(ZkMetaClientConfig config) {
+ _zkClient = new ZkClient(new ZkConnection(config.getConnectionAddress(),
+ (int) config.getSessionTimeoutInMillis()),
+ (int) config.getConnectionInitTimeoutInMillis(), -1
/*operationRetryTimeout*/,
+ config.getZkSerializer(), config.getMonitorType(),
config.getMonitorKey(),
+ config.getMonitorInstanceName(), config.getMonitorRootPathOnly());
Review Comment:
The preferred method for Client instantiation is through Factory class,
however, user could use constructor as well. The config can only be created
using Builder.
(Same as Current FederatedZkClient.)
--
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]