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 2020/06/13 01:07:33 UTC

[GitHub] [kafka] chia7712 opened a new pull request #8866: HOTFIX: fix compile error in o.a.k.c.u.TopicAdminTest

chia7712 opened a new pull request #8866:
URL: https://github.com/apache/kafka/pull/8866


   9a4f00f78bf37041006ae8b6432d194f603ac6cc changed the constructor of DescribeConfigsResponse.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

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



[GitHub] [kafka] kkonstantine commented on a change in pull request #8866: HOTFIX: fix compile error in o.a.k.c.u.TopicAdminTest

Posted by GitBox <gi...@apache.org>.
kkonstantine commented on a change in pull request #8866:
URL: https://github.com/apache/kafka/pull/8866#discussion_r439697258



##########
File path: connect/runtime/src/test/java/org/apache/kafka/connect/util/TopicAdminTest.java
##########
@@ -568,18 +570,20 @@ private DescribeConfigsResponse describeConfigsResponseWithTopicAuthorizationExc
 
     private DescribeConfigsResponse describeConfigsResponse(ApiError error, NewTopic... topics) {
         if (error == null) error = new ApiError(Errors.NONE, "");
-        Map<ConfigResource, DescribeConfigsResponse.Config> configs = new HashMap<>();
+        List<DescribeConfigsResponseData.DescribeConfigsResult> results = new ArrayList<>();
         for (NewTopic topic : topics) {
-            ConfigResource resource = new ConfigResource(ConfigResource.Type.TOPIC, topic.name());
-            DescribeConfigsResponse.ConfigSource source = DescribeConfigsResponse.ConfigSource.TOPIC_CONFIG;
-            Collection<DescribeConfigsResponse.ConfigEntry> entries = new ArrayList<>();
-            topic.configs().forEach((k, v) -> new DescribeConfigsResponse.ConfigEntry(
-                    k, v, source, false, false, Collections.emptySet()
-            ));
-            DescribeConfigsResponse.Config config = new DescribeConfigsResponse.Config(error, entries);
-            configs.put(resource, config);
-        }
-        return new DescribeConfigsResponse(1000, configs);
+            results.add(new DescribeConfigsResponseData.DescribeConfigsResult()
+                    .setErrorCode(error.error().code())
+                    .setErrorMessage(error.message())
+                    .setResourceType(ConfigResource.Type.TOPIC.id())
+                    .setResourceName(topic.name())
+                    .setConfigs(topic.configs().entrySet().stream().map(e -> new DescribeConfigsResponseData.DescribeConfigsResourceResult()
+                            .setName(e.getKey())
+                            .setValue(e.getValue())).collect(Collectors.toList())));
+        }
+        return new DescribeConfigsResponse(new DescribeConfigsResponseData()
+        .setThrottleTimeMs(1000)

Review comment:
       nit: indentation is off here. You may break at the second `new` and have the argument in one line probably

##########
File path: connect/runtime/src/test/java/org/apache/kafka/connect/util/TopicAdminTest.java
##########
@@ -568,18 +570,20 @@ private DescribeConfigsResponse describeConfigsResponseWithTopicAuthorizationExc
 
     private DescribeConfigsResponse describeConfigsResponse(ApiError error, NewTopic... topics) {
         if (error == null) error = new ApiError(Errors.NONE, "");
-        Map<ConfigResource, DescribeConfigsResponse.Config> configs = new HashMap<>();
+        List<DescribeConfigsResponseData.DescribeConfigsResult> results = new ArrayList<>();
         for (NewTopic topic : topics) {

Review comment:
       let's stream the topics and use a collector in the end. 




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

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



[GitHub] [kafka] kkonstantine merged pull request #8866: HOTFIX: Fix compile error in TopicAdminTest

Posted by GitBox <gi...@apache.org>.
kkonstantine merged pull request #8866:
URL: https://github.com/apache/kafka/pull/8866


   


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

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



[GitHub] [kafka] chia7712 commented on pull request #8866: HOTFIX: fix compile error in o.a.k.c.u.TopicAdminTest

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #8866:
URL: https://github.com/apache/kafka/pull/8866#issuecomment-643574076


   @abbccdda I attache the error message to the description.
   
   @kkonstantine I have addressed your comment
   
   Please take a look :)


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

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



[GitHub] [kafka] chia7712 commented on pull request #8866: HOTFIX: fix compile error in o.a.k.c.u.TopicAdminTest

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #8866:
URL: https://github.com/apache/kafka/pull/8866#issuecomment-643546377


   @tombentley Could you take a look? 


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

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



[GitHub] [kafka] kkonstantine commented on pull request #8866: HOTFIX: Fix compile error in TopicAdminTest

Posted by GitBox <gi...@apache.org>.
kkonstantine commented on pull request #8866:
URL: https://github.com/apache/kafka/pull/8866#issuecomment-643587843


   The few test failures were not relevant. Merging to fix the build anyways. 


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

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



[GitHub] [kafka] tombentley commented on pull request #8866: HOTFIX: fix compile error in o.a.k.c.u.TopicAdminTest

Posted by GitBox <gi...@apache.org>.
tombentley commented on pull request #8866:
URL: https://github.com/apache/kafka/pull/8866#issuecomment-643586508


   Sorry about breaking the build. Thanks @chia7712.


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

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