narendly commented on a change in pull request #846: [WIP] Make ZKHelixAdmin
and ZKHelixManager Realm-aware
URL: https://github.com/apache/helix/pull/846#discussion_r387494838
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
##########
@@ -89,33 +91,55 @@
public class ZKHelixAdmin implements HelixAdmin {
+ private static final Logger LOG =
LoggerFactory.getLogger(ZKHelixAdmin.class);
+
+
public static final String CONNECTION_TIMEOUT = "helixAdmin.timeOutInSec";
private static final String MAINTENANCE_ZNODE_ID = "maintenance";
private static final int DEFAULT_SUPERCLUSTER_REPLICA = 3;
- private final HelixZkClient _zkClient;
+ private final RealmAwareZkClient _zkClient;
private final ConfigAccessor _configAccessor;
// true if ZKHelixAdmin was instantiated with a HelixZkClient, false
otherwise
// This is used for close() to determine how ZKHelixAdmin should close the
underlying ZkClient
private final boolean _usesExternalZkClient;
private static Logger logger = LoggerFactory.getLogger(ZKHelixAdmin.class);
- @Deprecated
- public ZKHelixAdmin(HelixZkClient zkClient) {
+ public ZKHelixAdmin() {
+ _zkClient = new FederatedZkClient();
+ _configAccessor = new ConfigAccessor(_zkClient);
+ _usesExternalZkClient = false;
Review comment:
We should use a Builder pattern for HelixAdmin here. This is because we need
to allow users to provide connection and client configs.
For example, users should be able to set operationRetry time. If we just
provide a constructor that doesn't take in any parameters, it won't be very
flexible.
https://github.com/apache/helix/pull/819 for a reference.
----------------------------------------------------------------
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]