xyuanlu commented on code in PR #2612:
URL: https://github.com/apache/helix/pull/2612#discussion_r1323522423
##########
meta-client/src/main/java/org/apache/helix/metaclient/factories/MetaClientFactory.java:
##########
@@ -49,4 +50,20 @@ public MetaClientInterface getMetaClient(MetaClientConfig
config) {
}
return null;
}
+
+ public MetaClientCacheInterface getMetaClientCache(MetaClientConfig config,
MetaClientCacheConfig cacheConfig) {
+ if (config == null) {
+ throw new IllegalArgumentException("MetaClientConfig cannot be null.");
+ }
+ if (MetaClientConfig.StoreType.ZOOKEEPER.equals(config.getStoreType())) {
+ ZkMetaClientConfig zkMetaClientConfig = new
ZkMetaClientConfig.ZkMetaClientConfigBuilder().
+ setConnectionAddress(config.getConnectionAddress())
+
.setMetaClientReconnectPolicy(config.getMetaClientReconnectPolicy())
+
.setConnectionInitTimeoutInMillis(config.getConnectionInitTimeoutInMillis())
+ .setSessionTimeoutInMillis(config.getSessionTimeoutInMillis())
+ .build();
+ return new ZkMetaClientFactory().getMetaClientCache(zkMetaClientConfig,
cacheConfig);
Review Comment:
Forgot to mention it in prev comment. line 60-65 can be merged with line
44-49. Please address it in following PR.
--
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]