{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/177229820","pull_request_review_id":107067428,"id":177229820,"diff_hunk":"@@ -2070,4 +2086,318 @@ void handleFailure(Throwable throwable) {\n \n         return new DeleteRecordsResult(new HashMap<TopicPartition, KafkaFuture<DeletedRecords>>(futures));\n     }\n+\n+    @Override\n+    public DescribeConsumerGroupsResult describeConsumerGroups(final Collection<String> groupIds,\n+                                                               final DescribeConsumerGroupsOptions options) {\n+        final KafkaFutureImpl<Map<String, KafkaFuture<ConsumerGroupDescription>>> resultFutures = new KafkaFutureImpl<>();\n+        final Map<String, KafkaFutureImpl<ConsumerGroupDescription>> consumerGroupFutures = new HashMap<>(groupIds.size());\n+        final ArrayList<String> groupIdList = new ArrayList<>();\n+        for (String groupId : groupIds) {\n+            if (!consumerGroupFutures.containsKey(groupId)) {\n+                consumerGroupFutures.put(groupId, new KafkaFutureImpl<ConsumerGroupDescription>());\n+                groupIdList.add(groupId);\n+            }\n+        }\n+\n+        for (final String groupId : groupIdList) {\n+\n+            final long nowFindCoordinator = time.milliseconds();\n+            final long deadline = calcDeadlineMs(nowFindCoordinator, options.timeoutMs());\n+\n+            runnable.call(new Call(\"findCoordinator\", deadline, new ControllerNodeProvider()) {\n+                @Override\n+                AbstractRequest.Builder createRequest(int timeoutMs) {\n+                    return new FindCoordinatorRequest.Builder(FindCoordinatorRequest.CoordinatorType.GROUP, groupId);\n+                }\n+\n+                @Override\n+                void handleResponse(AbstractResponse abstractResponse) {\n+                    final FindCoordinatorResponse response = (FindCoordinatorResponse) abstractResponse;\n+\n+                    final long nowDescribeConsumerGroups = time.milliseconds();\n+\n+                    final int nodeId = response.node().id();\n+\n+                    runnable.call(new Call(\"describeConsumerGroups\", deadline, new ConstantNodeIdProvider(nodeId)) {\n+\n+                        @Override\n+                        AbstractRequest.Builder createRequest(int timeoutMs) {\n+                            return new DescribeGroupsRequest.Builder(groupIdList);\n+                        }\n+\n+                        @Override\n+                        void handleResponse(AbstractResponse abstractResponse) {\n+                            final DescribeGroupsResponse response = (DescribeGroupsResponse) abstractResponse;\n+                            // Handle server responses for particular groupId.\n+                            for (Map.Entry<String, KafkaFutureImpl<ConsumerGroupDescription>> entry : consumerGroupFutures.entrySet()) {\n+                                final String groupId = entry.getKey();\n+                                final KafkaFutureImpl<ConsumerGroupDescription> future = entry.getValue();\n+                                final DescribeGroupsResponse.GroupMetadata groupMetadata = response.groups().get(groupId);\n+                                final Errors groupError = groupMetadata.error();\n+                                if (groupError != Errors.NONE) {\n+                                    future.completeExceptionally(groupError.exception());\n+                                    continue;\n+                                }\n+\n+                                final String protocolType = groupMetadata.protocolType();\n+                                if (protocolType.equals(ConsumerProtocol.PROTOCOL_TYPE) || protocolType.isEmpty()) {\n+                                    final List<DescribeGroupsResponse.GroupMember> members = groupMetadata.members();\n+                                    final List<MemberDescription> consumers = new ArrayList<>(members.size());\n+\n+                                    for (DescribeGroupsResponse.GroupMember groupMember : members) {\n+                                        final PartitionAssignor.Assignment assignment =\n+                                            ConsumerProtocol.deserializeAssignment(\n+                                                ByteBuffer.wrap(Utils.readBytes(groupMember.memberAssignment())));\n+\n+                                        final MemberDescription memberDescription =\n+                                            new MemberDescription(\n+                                                groupMember.clientId(),\n+                                                groupMember.memberId(),\n+                                                groupMember.clientHost(),\n+                                                new MemberAssignment(assignment.partitions()));\n+                                        consumers.add(memberDescription);\n+                                    }\n+                                    final String protocol = groupMetadata.protocol();\n+                                    final ConsumerGroupDescription consumerGroupDescription =\n+                                        new ConsumerGroupDescription(groupId, protocolType.isEmpty(), consumers, protocol);\n+                                    future.complete(consumerGroupDescription);\n+                                }\n+                            }\n+                        }\n+\n+                        @Override\n+                        void handleFailure(Throwable throwable) {\n+                            completeAllExceptionally(consumerGroupFutures.values(), throwable);\n+                        }\n+                    }, nowDescribeConsumerGroups);\n+\n+                    resultFutures.complete(new HashMap<String, KafkaFuture<ConsumerGroupDescription>>(consumerGroupFutures));\n+                }\n+\n+                @Override\n+                void handleFailure(Throwable throwable) {\n+                    if (throwable instanceof NotCoordinatorException) {","path":"clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java","position":null,"original_position":152,"commit_id":"48a59af8d4d95b70880398ee2e84746538f071a0","original_commit_id":"3e1e13701ad518b9057ef43100f706e2bf47ddbf","user":{"login":"jeqo","id":6180701,"avatar_url":"https://avatars0.githubusercontent.com/u/6180701?v=4","gravatar_id":"","url":"https://api.github.com/users/jeqo","html_url":"https://github.com/jeqo","followers_url":"https://api.github.com/users/jeqo/followers","following_url":"https://api.github.com/users/jeqo/following{/other_user}","gists_url":"https://api.github.com/users/jeqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jeqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeqo/subscriptions","organizations_url":"https://api.github.com/users/jeqo/orgs","repos_url":"https://api.github.com/users/jeqo/repos","events_url":"https://api.github.com/users/jeqo/events{/privacy}","received_events_url":"https://api.github.com/users/jeqo/received_events","type":"User","site_admin":false},"body":"agree.","created_at":"2018-03-26T20:49:16Z","updated_at":"2018-03-26T20:49:16Z","html_url":"https://github.com/apache/kafka/pull/4454#discussion_r177229820","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/4454","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/177229820"},"html":{"href":"https://github.com/apache/kafka/pull/4454#discussion_r177229820"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/4454"}},"in_reply_to_id":176875470},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/4454","id":164200966,"html_url":"https://github.com/apache/kafka/pull/4454","diff_url":"https://github.com/apache/kafka/pull/4454.diff","patch_url":"https://github.com/apache/kafka/pull/4454.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/4454","number":4454,"state":"open","locked":false,"title":"KIP-222 - Add Consumer Group operations to Admin API","user":{"login":"jeqo","id":6180701,"avatar_url":"https://avatars0.githubusercontent.com/u/6180701?v=4","gravatar_id":"","url":"https://api.github.com/users/jeqo","html_url":"https://github.com/jeqo","followers_url":"https://api.github.com/users/jeqo/followers","following_url":"https://api.github.com/users/jeqo/following{/other_user}","gists_url":"https://api.github.com/users/jeqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jeqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeqo/subscriptions","organizations_url":"https://api.github.com/users/jeqo/orgs","repos_url":"https://api.github.com/users/jeqo/repos","events_url":"https://api.github.com/users/jeqo/events{/privacy}","received_events_url":"https://api.github.com/users/jeqo/received_events","type":"User","site_admin":false},"body":"KIP: https://cwiki.apache.org/confluence/display/KAFKA/KIP-222+-+Add+Consumer+Group+operations+to+Admin+API \r\n","created_at":"2018-01-21T23:18:15Z","updated_at":"2018-03-26T20:49:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db3d8f980227012d9767f8e14515e23ee5b38e79","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/4454/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/4454/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/4454/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/48a59af8d4d95b70880398ee2e84746538f071a0","head":{"label":"jeqo:feature/admin-client-describe-consumer-group","ref":"feature/admin-client-describe-consumer-group","sha":"48a59af8d4d95b70880398ee2e84746538f071a0","user":{"login":"jeqo","id":6180701,"avatar_url":"https://avatars0.githubusercontent.com/u/6180701?v=4","gravatar_id":"","url":"https://api.github.com/users/jeqo","html_url":"https://github.com/jeqo","followers_url":"https://api.github.com/users/jeqo/followers","following_url":"https://api.github.com/users/jeqo/following{/other_user}","gists_url":"https://api.github.com/users/jeqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jeqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeqo/subscriptions","organizations_url":"https://api.github.com/users/jeqo/orgs","repos_url":"https://api.github.com/users/jeqo/repos","events_url":"https://api.github.com/users/jeqo/events{/privacy}","received_events_url":"https://api.github.com/users/jeqo/received_events","type":"User","site_admin":false},"repo":{"id":80715060,"name":"kafka","full_name":"jeqo/kafka","owner":{"login":"jeqo","id":6180701,"avatar_url":"https://avatars0.githubusercontent.com/u/6180701?v=4","gravatar_id":"","url":"https://api.github.com/users/jeqo","html_url":"https://github.com/jeqo","followers_url":"https://api.github.com/users/jeqo/followers","following_url":"https://api.github.com/users/jeqo/following{/other_user}","gists_url":"https://api.github.com/users/jeqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jeqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeqo/subscriptions","organizations_url":"https://api.github.com/users/jeqo/orgs","repos_url":"https://api.github.com/users/jeqo/repos","events_url":"https://api.github.com/users/jeqo/events{/privacy}","received_events_url":"https://api.github.com/users/jeqo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeqo/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/jeqo/kafka","forks_url":"https://api.github.com/repos/jeqo/kafka/forks","keys_url":"https://api.github.com/repos/jeqo/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeqo/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeqo/kafka/teams","hooks_url":"https://api.github.com/repos/jeqo/kafka/hooks","issue_events_url":"https://api.github.com/repos/jeqo/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/jeqo/kafka/events","assignees_url":"https://api.github.com/repos/jeqo/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/jeqo/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/jeqo/kafka/tags","blobs_url":"https://api.github.com/repos/jeqo/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeqo/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeqo/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeqo/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeqo/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/jeqo/kafka/languages","stargazers_url":"https://api.github.com/repos/jeqo/kafka/stargazers","contributors_url":"https://api.github.com/repos/jeqo/kafka/contributors","subscribers_url":"https://api.github.com/repos/jeqo/kafka/subscribers","subscription_url":"https://api.github.com/repos/jeqo/kafka/subscription","commits_url":"https://api.github.com/repos/jeqo/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeqo/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeqo/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeqo/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeqo/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/jeqo/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeqo/kafka/merges","archive_url":"https://api.github.com/repos/jeqo/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeqo/kafka/downloads","issues_url":"https://api.github.com/repos/jeqo/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/jeqo/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/jeqo/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/jeqo/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeqo/kafka/labels{/name}","releases_url":"https://api.github.com/repos/jeqo/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/jeqo/kafka/deployments","created_at":"2017-02-02T10:33:25Z","updated_at":"2018-03-21T22:41:31Z","pushed_at":"2018-03-26T20:48:37Z","git_url":"git://github.com/jeqo/kafka.git","ssh_url":"git@github.com:jeqo/kafka.git","clone_url":"https://github.com/jeqo/kafka.git","svn_url":"https://github.com/jeqo/kafka","homepage":null,"size":62089,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":1,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"2f90cb86c18e854fd687ea7bbeb8692178bbb02d","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2018-03-26T20:26:42Z","pushed_at":"2018-03-26T20:48:41Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":63752,"stargazers_count":7788,"watchers_count":7788,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4612,"mirror_url":null,"archived":false,"open_issues_count":432,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":4612,"open_issues":432,"watchers":7788,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/4454"},"html":{"href":"https://github.com/apache/kafka/pull/4454"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/4454"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/4454/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/4454/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/4454/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/48a59af8d4d95b70880398ee2e84746538f071a0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jeqo"}}