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/09/13 00:33:09 UTC

[GitHub] [kafka] akhileshchg commented on a diff in pull request #12627: KAFKA-14214: Introduce read-write lock to StandardAuthorizer for consistent ACL reads.

akhileshchg commented on code in PR #12627:
URL: https://github.com/apache/kafka/pull/12627#discussion_r969037841


##########
metadata/src/main/java/org/apache/kafka/metadata/authorizer/StandardAuthorizer.java:
##########
@@ -129,23 +151,24 @@ public synchronized void loadSnapshot(Map<Uuid, StandardAcl> acls) {
     public List<AuthorizationResult> authorize(
             AuthorizableRequestContext requestContext,
             List<Action> actions) {
-        StandardAuthorizerData curData = data;
-        List<AuthorizationResult> results = new ArrayList<>(actions.size());
-        for (Action action: actions) {
-            AuthorizationResult result = curData.authorize(requestContext, action);
-            results.add(result);
-        }
-        return results;
+        return inReadLock(() -> {

Review Comment:
   Okay. I'll remove the functions. 



##########
metadata/src/main/java/org/apache/kafka/metadata/authorizer/StandardAuthorizerData.java:
##########
@@ -534,49 +536,19 @@ Iterable<AclBinding> acls(AclBindingFilter filter) {
     }
 
     class AclIterable implements Iterable<AclBinding> {

Review Comment:
   Done.



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