You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/02 10:00:27 UTC

[GitHub] [pulsar] nodece commented on a diff in pull request #16815: [improve] clean the empty topicAuthenticationMap in zk when revoke permission

nodece commented on code in PR #16815:
URL: https://github.com/apache/pulsar/pull/16815#discussion_r961511797


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -359,7 +359,13 @@ private CompletableFuture<Void> revokePermissionsAsync(String topicUri, String r
                     }
                     // Write the new policies to metadata store
                     return namespaceResources().setPoliciesAsync(namespaceName, p -> {
-                        p.auth_policies.getTopicAuthentication().get(topicUri).remove(role);
+                        p.auth_policies.getTopicAuthentication().computeIfPresent(topicUri, (k, roles) -> {
+                            roles.remove(role);

Review Comment:
   The `roles` is ImmutableCollections. 



-- 
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: commits-unsubscribe@pulsar.apache.org

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