Skip to content

Commit

Permalink
Fix other Potential Instances Of Usage Of RemoveAll With Lists (#969)
Browse files Browse the repository at this point in the history
Co-authored-by: Shrinand Thakkar <sthakkar@sthakkar-mn2.linkedin.biz>
  • Loading branch information
shrinandthakkar and Shrinand Thakkar authored Oct 31, 2023
1 parent b31e41a commit c082369
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ protected void partitionSanityChecks(Map<String, Set<DatastreamTask>> assignedTa
for (DatastreamTask task : tasksSet) {
if (datastreamGroupName.equals(task.getTaskPrefix())) {
total += task.getPartitionsV2().size();
unassignedPartitions.removeAll(task.getPartitionsV2());
unassignedPartitions.removeAll(new HashSet<>(task.getPartitionsV2()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ private void diffAssignmentNodes(Map<String, List<DatastreamTask>> assignmentsBy
// find assignments added
//
Set<String> added = new HashSet<>(assignmentsNames);
added.removeAll(oldAssignmentNames);
added.removeAll(new HashSet<>(oldAssignmentNames));
nodesToAdd.put(instance, added);
}
}
Expand Down Expand Up @@ -1120,7 +1120,7 @@ public void cleanUpDeadInstanceDataAndOtherUnusedTasks(
Set<DatastreamTask> unusedTasks = findOldUnusedTasks(previousAssignmentByInstance, newAssignmentsByInstance);

Set<String> deadInstances = previousAssignmentByInstance.keySet();
deadInstances.removeAll(liveInstances);
deadInstances.removeAll(new HashSet<>(liveInstances));

LOG.debug("unusedTasks before cleanup: {}", unusedTasks.stream()
.map(DatastreamTask::getDatastreamTaskName)
Expand Down

0 comments on commit c082369

Please sign in to comment.