-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-19178: Replace Vector by ArrayList for PluginClassLoader#getResources #19529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Could you also refactor Vector as ArrayList in
Line 115 in 18584b1
Vector<AclBinding> aclBindings = FakeLocalMetadataStore.ALL_ACLS.getOrDefault(principal, new Vector<>()); |
Thanks.
@FrankYang0529 Thanks for the suggestion! I just have one concern — in our current test setup,both the |
@Rancho-7 the returned type |
Since this change will only affect the test scenarios and to maintain consistency in the code, I believe replacing it with |
@@ -112,7 +112,7 @@ public static List<AclBinding> aclBindings(String aclPrinciple) { | |||
* @param aclBinding {@link AclBinding} | |||
*/ | |||
public static void addACLs(String principal, AclBinding aclBinding) { | |||
Vector<AclBinding> aclBindings = FakeLocalMetadataStore.ALL_ACLS.getOrDefault(principal, new Vector<>()); | |||
List<AclBinding> aclBindings = FakeLocalMetadataStore.ALL_ACLS.getOrDefault(principal, new ArrayList<>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is interesting. It seems those methods should be thread-safe, but it isn't. Could you please revert those changes and then open a jira for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened https://issues.apache.org/jira/browse/KAFKA-19196 to track this.
jira: https://issues.apache.org/jira/browse/KAFKA-19178
The vector is a synchronized collection, and in the case we don't need
to sync. Also, we can use
Collections.enumeration
to convertcollection to enumeration easily.
Reviewers: PoAn Yang [email protected], Ken Huang
[email protected], Chia-Ping Tsai [email protected]