pkuwm commented on a change in pull request #861: Make ClusterSetup realm-aware
URL: https://github.com/apache/helix/pull/861#discussion_r391125269
##########
File path: helix-core/src/main/java/org/apache/helix/ConfigAccessor.java
##########
@@ -123,23 +127,23 @@ public ConfigAccessor(RealmAwareZkClient zkClient) {
* @param zkAddress
*/
public ConfigAccessor(String zkAddress) {
- // First, attempt to connect on multi-realm mode using FederatedZkClient
- RealmAwareZkClient zkClient;
- try {
- zkClient = new FederatedZkClient(
- new
RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(),
- new RealmAwareZkClient.RealmAwareZkClientConfig());
- } catch (IOException | InvalidRoutingDataException | IllegalStateException
e) {
- // Connecting multi-realm failed - fall back to creating it on
single-realm mode using the given ZK address
- LOG.info(
- "ConfigAccessor: not able to connect on multi-realm mode; connecting
single-realm mode to ZK: {}",
- zkAddress, e);
- zkClient = SharedZkClientFactory.getInstance()
- .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress),
- new HelixZkClient.ZkClientConfig().setZkSerializer(new
ZNRecordSerializer()));
- }
- _zkClient = zkClient;
_usesExternalZkClient = false;
+
+ // If the multi ZK config is enabled, use FederatedZkClient on multi-realm
mode
+ if
(Boolean.parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED)))
{
Review comment:
Nit: not sure whether or not we would allow users to set upper case “TRUE”
and honor it as true. I just use getBoolean() to restrict it to true if and
only if string is lowercase “true”.
----------------------------------------------------------------
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]