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/10/29 17:06:30 UTC

[GitHub] [helix] NealSun96 commented on a change in pull request #1468: Implement deleteTask API

NealSun96 commented on a change in pull request #1468:
URL: https://github.com/apache/helix/pull/1468#discussion_r513846668



##########
File path: helix-core/src/main/java/org/apache/helix/task/FixedTargetTaskAssignmentCalculator.java
##########
@@ -123,6 +124,17 @@ public FixedTargetTaskAssignmentCalculator(AssignableInstanceManager assignableI
     return taskPartitions;
   }
 
+  @Override
+  public Set<Integer> getRemovedPartitions(JobConfig jobConfig, JobContext jobContext, Set<Integer> allPartitions) {
+    Set<Integer> deletedPartitions = new HashSet<>();
+    for (Integer partition : jobContext.getPartitionSet()) {
+      if (!allPartitions.contains(partition)) {
+        deletedPartitions.add(partition);
+      }
+    }
+    return deletedPartitions;

Review comment:
       nit: can probably be condensed to one line. 




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