mimaison commented on code in PR #15558:
URL: https://github.com/apache/kafka/pull/15558#discussion_r1532418821


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java:
##########
@@ -630,8 +631,16 @@ Map<String, Config> describeTopicConfigs(Set<String> 
topics)
         Set<ConfigResource> resources = topics.stream()
             .map(x -> new ConfigResource(ConfigResource.Type.TOPIC, x))
             .collect(Collectors.toSet());
-        return 
sourceAdminClient.describeConfigs(resources).all().get().entrySet().stream()
-            .collect(Collectors.toMap(x -> x.getKey().name(), 
Entry::getValue));
+        try {

Review Comment:
   This only improves this single call, there are a bunch of other admin calls 
runs by the Schedulers that should also be updated. Considering the number of 
calls, it might make sense to have a helper method to wrap the calls and avoid 
too much duplication.



##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorSourceConnectorTest.java:
##########
@@ -224,6 +229,39 @@ public void testNoBrokerAclAuthorizer() throws Exception {
         verifyNoInteractions(targetAdmin);
     }
 
+    @Test
+    public void testMissingDescribeConfigsAcl() throws Exception {
+        Admin sourceAdmin = mock(Admin.class);
+        Admin targetAdmin = mock(Admin.class);
+        MirrorSourceConnector connector = new 
MirrorSourceConnector(sourceAdmin, targetAdmin);
+        Field configField = connector.getClass().getDeclaredField("config");

Review Comment:
   Instead of using reflection, I wonder if it would be better to adjust one of 
the existing constructors used for testing.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to