You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/10 20:01:05 UTC

[GitHub] [kafka] hachikuji commented on a diff in pull request #12145: KAFKA-13892: Dedupe RemoveAccessControlEntryRecord in deleteAcls response of AclControlManager

hachikuji commented on code in PR #12145:
URL: https://github.com/apache/kafka/pull/12145#discussion_r869633002


##########
metadata/src/main/java/org/apache/kafka/controller/AclControlManager.java:
##########
@@ -152,7 +154,11 @@ ControllerResult<List<AclDeleteResult>> deleteAcls(List<AclBindingFilter> filter
                 results.add(new AclDeleteResult(ApiError.fromThrowable(e).exception()));
             }
         }
-        return ControllerResult.atomicOf(records, results);
+        return ControllerResult.atomicOf(dedupeApiMessageAndVersion(records), results);
+    }
+
+    private List<ApiMessageAndVersion> dedupeApiMessageAndVersion(List<ApiMessageAndVersion> messages) {
+        return new HashSet<>(messages).stream().collect(Collectors.toList());

Review Comment:
   nit: doesn't make a big difference, but any reason not to begin with a Set instead of converting from a List?



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

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org