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/04/10 21:20:48 UTC

[GitHub] [helix] mgao0 opened a new pull request #946: Move routing table provider initialization

mgao0 opened a new pull request #946: Move routing table provider initialization
URL: https://github.com/apache/helix/pull/946
 
 
   ### Issues
   
   - [ ] My PR addresses the following Helix issues and references them in the PR description:
   In current test we initialize routing table provider after updating customized state, and there are several re-initialization of routing table provider at different places during the test to set different data sources. Although routing table provider will fetch correct results in this way, it does not represent a common way how our customers should use routing table provider. This PR fixes this problem.
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI changes:
   
   This PR moves the initialization of routing table provider to before class so it is initialized before any updates. In addition, in this PR re-initializations of routing table provider during the test are removed. Also, added several checks into the validation method to cover some edge cases. 
   
   ### Tests
   
   - [ ] The following tests are written for this issue:
   
   (List the names of added unit/integration tests)
   
   - [ ] The following is the result of the "mvn test" command on the appropriate module:
   
   (Copy & paste the result of "mvn test")
   
   ### Commits
   
   - [ ] 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
   
   - [ ] 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] zhangmeng916 commented on a change in pull request #946: Move routing table provider initialization

Posted by GitBox <gi...@apache.org>.
zhangmeng916 commented on a change in pull request #946: Move routing table provider initialization
URL: https://github.com/apache/helix/pull/946#discussion_r406950372
 
 

 ##########
 File path: helix-core/src/test/java/org/apache/helix/integration/TestCustomizedViewAggregation.java
 ##########
 @@ -120,6 +118,23 @@ public void beforeClass() throws Exception {
     _localCustomizedView = new HashMap<>();
     _routingTableProviderDataSources = new HashSet<>();
     _aggregationEnabledTypes = new HashSet<>();
+
+    List<String> customizedStateTypes = Arrays
+        .asList(CustomizedStateType.TYPE_A.name(), CustomizedStateType.TYPE_B.name(),
+            CustomizedStateType.TYPE_C.name());
+
+    CustomizedStateConfig.Builder customizedStateConfigBuilder =
+        new CustomizedStateConfig.Builder();
+    customizedStateConfigBuilder.setAggregationEnabledTypes(customizedStateTypes);
+    HelixDataAccessor accessor = _manager.getHelixDataAccessor();
+    accessor.setProperty(accessor.keyBuilder().customizedStateConfig(),
+        customizedStateConfigBuilder.build());
+    _aggregationEnabledTypes.addAll(customizedStateTypes);
+
+    Map<PropertyType, List<String>> dataSource = new HashMap<>();
+    dataSource.put(PropertyType.CUSTOMIZEDVIEW, customizedStateTypes);
+    _routingTableProvider = new RoutingTableProvider(_spectator, dataSource);
+    _routingTableProviderDataSources.addAll(customizedStateTypes);
 
 Review comment:
   can we try somewhere in the test process to initialize a new routing table provider with different types? A little concerned that we have only one fixed data resources input here. Let's put the initialization before the update of config/states, and see whether that's stable. 

----------------------------------------------------------------
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] mgao0 commented on issue #946: Move routing table provider initialization

Posted by GitBox <gi...@apache.org>.
mgao0 commented on issue #946: Move routing table provider initialization
URL: https://github.com/apache/helix/pull/946#issuecomment-613014189
 
 
   This PR is ready to be merged, approved by @zhangmeng916
   
   Final commit message:
   This PR moves the initialization of routing table provider to before class so it is initialized before any updates. Also, added several checks into the validation method to cover some edge cases.

----------------------------------------------------------------
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] jiajunwang merged pull request #946: Move routing table provider initialization

Posted by GitBox <gi...@apache.org>.
jiajunwang merged pull request #946: Move routing table provider initialization
URL: https://github.com/apache/helix/pull/946
 
 
   

----------------------------------------------------------------
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] mgao0 commented on a change in pull request #946: Move routing table provider initialization

Posted by GitBox <gi...@apache.org>.
mgao0 commented on a change in pull request #946: Move routing table provider initialization
URL: https://github.com/apache/helix/pull/946#discussion_r406959499
 
 

 ##########
 File path: helix-core/src/test/java/org/apache/helix/integration/TestCustomizedViewAggregation.java
 ##########
 @@ -120,6 +118,23 @@ public void beforeClass() throws Exception {
     _localCustomizedView = new HashMap<>();
     _routingTableProviderDataSources = new HashSet<>();
     _aggregationEnabledTypes = new HashSet<>();
+
+    List<String> customizedStateTypes = Arrays
+        .asList(CustomizedStateType.TYPE_A.name(), CustomizedStateType.TYPE_B.name(),
+            CustomizedStateType.TYPE_C.name());
+
+    CustomizedStateConfig.Builder customizedStateConfigBuilder =
+        new CustomizedStateConfig.Builder();
+    customizedStateConfigBuilder.setAggregationEnabledTypes(customizedStateTypes);
+    HelixDataAccessor accessor = _manager.getHelixDataAccessor();
+    accessor.setProperty(accessor.keyBuilder().customizedStateConfig(),
+        customizedStateConfigBuilder.build());
+    _aggregationEnabledTypes.addAll(customizedStateTypes);
+
+    Map<PropertyType, List<String>> dataSource = new HashMap<>();
+    dataSource.put(PropertyType.CUSTOMIZEDVIEW, customizedStateTypes);
+    _routingTableProvider = new RoutingTableProvider(_spectator, dataSource);
+    _routingTableProviderDataSources.addAll(customizedStateTypes);
 
 Review comment:
   Good point. I added back two tests on this.

----------------------------------------------------------------
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