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/08 19:03:40 UTC

[GitHub] [helix] zhangmeng916 opened a new pull request #934: Add cache update/delete in customized view aggregation stage

zhangmeng916 opened a new pull request #934: Add cache update/delete in customized view aggregation stage
URL: https://github.com/apache/helix/pull/934
 
 
   ### Issues
   
   - [X] My PR addresses the following Helix issues and references them in the PR description:
   
   (#888 )
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   
   This PR adds the customized view cache update/delete operation in customized view aggregation stage. Previously, we depend on routing table provider to update customized view cache, and we found there're some cases we see inconsistency between cache and zk due to the lag between routing table provider and controller. To handle cache in the customized view aggregation stage could avoid such problems.
   
   ### Tests
   
   - [ ] The following is the result of the "mvn test" command on the appropriate module:
   
   (Copy & paste the result of "mvn test")
   
   ### 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"
   
   ### 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 merged pull request #934: Add cache update/delete in customized view aggregation stage

Posted by GitBox <gi...@apache.org>.
narendly merged pull request #934: Add cache update/delete in customized view aggregation stage
URL: https://github.com/apache/helix/pull/934
 
 
   

----------------------------------------------------------------
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 issue #934: Add cache update/delete in customized view aggregation stage

Posted by GitBox <gi...@apache.org>.
zhangmeng916 commented on issue #934: Add cache update/delete in customized view aggregation stage
URL: https://github.com/apache/helix/pull/934#issuecomment-611887398
 
 
   This PR is ready to merge, approved by @jiajunwang 
   final commit message:
   "Add customized view cache update in customized view aggregation stage. This is to ensure that the cache does not have stale data"

----------------------------------------------------------------
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 commented on a change in pull request #934: Add cache update/delete in customized view aggregation stage

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #934: Add cache update/delete in customized view aggregation stage
URL: https://github.com/apache/helix/pull/934#discussion_r406603544
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/dataproviders/ResourceControllerDataProvider.java
 ##########
 @@ -281,12 +300,24 @@ public void removeExternalViews(List<String> resourceNames) {
    * @param stateTypeNames
    */
 
-  private void removeCustomizedViewTypes(Set<String> stateTypeNames) {
+  public void removeCustomizedViewTypes(Set<String> stateTypeNames) {
     for (String stateType : stateTypeNames) {
       _customizedViewCacheMap.remove(stateType);
     }
   }
 
+  /**
+   * Remove dead customized views for a certain state type from customized view cache
+   * @param stateType a specific customized state type
+   * @param resourceNames the names of resources whose customized view is stale
+   */
+  public void removeCustomizedViews(String stateType, List<String> resourceNames) {
+    for (String resourceName : resourceNames) {
+      _customizedViewCacheMap.get(stateType).getCustomizedViewCache()
 
 Review comment:
   Safer to check if the stateType exists or not.

----------------------------------------------------------------
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 commented on a change in pull request #934: Add cache update/delete in customized view aggregation stage

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #934: Add cache update/delete in customized view aggregation stage
URL: https://github.com/apache/helix/pull/934#discussion_r406603326
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/dataproviders/ResourceControllerDataProvider.java
 ##########
 @@ -257,6 +258,24 @@ public void updateExternalViews(List<ExternalView> externalViews) {
     }
   }
 
+  /**
+   * Update the cached customized view map
+   * @param customizedViews
+   */
+  public void updateCustomizedViews(String customizedStateType,
+      List<CustomizedView> customizedViews) {
+    for (CustomizedView cv : customizedViews) {
+      if (_customizedViewCacheMap.containsKey(customizedStateType)) {
 
 Review comment:
   nit, You can move this condition out of the loop by checking and adding key if not exists.
   Then in the loop, you only need to set property.

----------------------------------------------------------------
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 commented on a change in pull request #934: Add cache update/delete in customized view aggregation stage

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #934: Add cache update/delete in customized view aggregation stage
URL: https://github.com/apache/helix/pull/934#discussion_r406603326
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/dataproviders/ResourceControllerDataProvider.java
 ##########
 @@ -257,6 +258,24 @@ public void updateExternalViews(List<ExternalView> externalViews) {
     }
   }
 
+  /**
+   * Update the cached customized view map
+   * @param customizedViews
+   */
+  public void updateCustomizedViews(String customizedStateType,
+      List<CustomizedView> customizedViews) {
+    for (CustomizedView cv : customizedViews) {
+      if (_customizedViewCacheMap.containsKey(customizedStateType)) {
 
 Review comment:
   You can move this condition out of the loop by checking and adding key if not exists.
   Then in the loop, you only need to set property.

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