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/08/07 00:12:12 UTC

[GitHub] [helix] zhangmeng916 commented on a change in pull request #1225: Update customized view after all calculation is done

zhangmeng916 commented on a change in pull request #1225:
URL: https://github.com/apache/helix/pull/1225#discussion_r466750923



##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/CustomizedViewAggregationStage.java
##########
@@ -98,34 +98,34 @@ public void execute(final ClusterEvent event) throws Exception {
         try {
           computeCustomizedStateView(resource, stateType, customizedStateOutput, curCustomizedViews,
               updatedCustomizedViews);
-
-          List<PropertyKey> keys = new ArrayList<>();
-          for (Iterator<CustomizedView> it = updatedCustomizedViews.iterator(); it.hasNext(); ) {
-            CustomizedView view = it.next();
-            String resourceName = view.getResourceName();
-            keys.add(keyBuilder.customizedView(stateType, resourceName));
-          }
-          // add/update customized-views from zk and cache
-          if (updatedCustomizedViews.size() > 0) {
-            dataAccessor.setChildren(keys, updatedCustomizedViews);
-            cache.updateCustomizedViews(stateType, updatedCustomizedViews);
-          }
-
-          // remove stale customized views from zk and cache
-          List<String> customizedViewToRemove = new ArrayList<>();
-          for (String resourceName : curCustomizedViews.keySet()) {
-            if (!resourceMap.keySet().contains(resourceName)) {
-              LogUtil.logInfo(LOG, _eventId, "Remove customizedView for resource: " + resourceName);
-              dataAccessor.removeProperty(keyBuilder.customizedView(stateType, resourceName));
-              customizedViewToRemove.add(resourceName);
-            }
-          }
-          cache.removeCustomizedViews(stateType, customizedViewToRemove);
         } catch (HelixException ex) {

Review comment:
       The purpose is to keep the loop continue without stopping at a possible exception thrown by a resource. For the zk exceptions, we may not want to hide them. We will let them thrown out and stop the pipeline if necessary. 




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



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