You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/03/13 06:48:39 UTC

[GitHub] [helix] narendly opened a new pull request #896: Make ZkUtil realm-aware

narendly opened a new pull request #896: Make ZkUtil realm-aware
URL: https://github.com/apache/helix/pull/896
 
 
   ### Issues
   
   - [x] My PR addresses the following Helix issues and references them in the PR description:
   
   Fixes #891 
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   
   There were some places that were missed in previous PRs. This makes ZkUtil realm-aware.
   
   ### Tests
   
   See https://github.com/apache/helix/pull/892
   
   ### Commits
   
   - [x] My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation (Optional)
   
   - [ ] In case of new functionality, my PR adds documentation in the following wiki page:
   
   (Link the GitHub wiki you added)
   
   ### Code Quality
   
   - [x] My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #896: Make ZkUtil realm-aware

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #896: Make ZkUtil realm-aware
URL: https://github.com/apache/helix/pull/896#discussion_r392537407
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
 ##########
 @@ -601,16 +607,30 @@ public static String toHexSessionId(long sessionId) {
   }
 
   /**
-   * Returns a dedicated ZkClient.
+   * Returns a dedicated ZkClient. A federatedZkClient will be used on multi-zk mode.
+   * WARNING: ephemeral operations will not be supported on multi-zk mode!
    * @return
    */
-  private static HelixZkClient getHelixZkClient(String zkAddr) {
-    if (zkAddr == null || zkAddr.isEmpty()) {
-      throw new HelixException("ZK Address given is either null or empty!");
+  private static RealmAwareZkClient getHelixZkClient(String zkAddr) {
+    if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED)) {
+      try {
+        // Create realm-aware ZkClient.
+        RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig =
+            new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build();
+        RealmAwareZkClient.RealmAwareZkClientConfig clientConfig =
+            new RealmAwareZkClient.RealmAwareZkClientConfig();
+        return new FederatedZkClient(connectionConfig, clientConfig);
+      } catch (IllegalArgumentException | IOException | InvalidRoutingDataException e) {
+        throw new HelixException("Not able to connect on realm-aware mode", e);
+      }
+    } else {
 
 Review comment:
   Removed the else clause

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] pkuwm commented on a change in pull request #896: Make ZkUtil realm-aware

Posted by GitBox <gi...@apache.org>.
pkuwm commented on a change in pull request #896: Make ZkUtil realm-aware
URL: https://github.com/apache/helix/pull/896#discussion_r392504943
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
 ##########
 @@ -601,16 +607,30 @@ public static String toHexSessionId(long sessionId) {
   }
 
   /**
-   * Returns a dedicated ZkClient.
+   * Returns a dedicated ZkClient. A federatedZkClient will be used on multi-zk mode.
+   * WARNING: ephemeral operations will not be supported on multi-zk mode!
    * @return
    */
-  private static HelixZkClient getHelixZkClient(String zkAddr) {
-    if (zkAddr == null || zkAddr.isEmpty()) {
-      throw new HelixException("ZK Address given is either null or empty!");
+  private static RealmAwareZkClient getHelixZkClient(String zkAddr) {
+    if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED)) {
+      try {
+        // Create realm-aware ZkClient.
+        RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig =
+            new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build();
+        RealmAwareZkClient.RealmAwareZkClientConfig clientConfig =
+            new RealmAwareZkClient.RealmAwareZkClientConfig();
+        return new FederatedZkClient(connectionConfig, clientConfig);
+      } catch (IllegalArgumentException | IOException | InvalidRoutingDataException e) {
+        throw new HelixException("Not able to connect on realm-aware mode", e);
+      }
+    } else {
 
 Review comment:
   Nit, no need for else.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly merged pull request #896: Make ZkUtil realm-aware

Posted by GitBox <gi...@apache.org>.
narendly merged pull request #896: Make ZkUtil realm-aware
URL: https://github.com/apache/helix/pull/896
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on issue #896: Make ZkUtil realm-aware

Posted by GitBox <gi...@apache.org>.
narendly commented on issue #896: Make ZkUtil realm-aware
URL: https://github.com/apache/helix/pull/896#issuecomment-598983061
 
 
   This PR is ready to be merged, approved by @pkuwm 
   
   There were some places in the code that were missed in previous PRs. This makes ZkUtil realm-aware by replacing HelixZkClient with RealmAwareZkClient.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org