{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/190313419","pull_request_review_id":122664394,"id":190313419,"diff_hunk":"@@ -2470,52 +2467,40 @@ public ListConsumerGroupsResult listConsumerGroups(ListConsumerGroupsOptions opt\n         final KafkaFutureImpl<Collection<Object>> all = new KafkaFutureImpl<>();\n         final long nowMetadata = time.milliseconds();\n         final long deadline = calcDeadlineMs(nowMetadata, options.timeoutMs());\n-        runnable.call(new Call(\"findGroupsMetadata\", deadline, new LeastLoadedNodeProvider()) {\n+        runnable.call(new Call(\"findAllBrokers\", deadline, new LeastLoadedNodeProvider()) {\n             @Override\n             AbstractRequest.Builder createRequest(int timeoutMs) {\n-                return new MetadataRequest.Builder(Collections.singletonList(Topic.GROUP_METADATA_TOPIC_NAME), true);\n+                return new MetadataRequest.Builder(Collections.<String>emptyList(), true);\n             }\n \n             @Override\n             void handleResponse(AbstractResponse abstractResponse) {\n                 MetadataResponse metadataResponse = (MetadataResponse) abstractResponse;\n-                final List<Throwable> metadataExceptions = new ArrayList<>();\n-                final HashSet<Node> leaders = new HashSet<>();\n-                for (final MetadataResponse.TopicMetadata metadata : metadataResponse.topicMetadata()) {\n-                    if (metadata.error() != Errors.NONE) {\n-                        metadataExceptions.add(metadata.error().exception(\"Unable to locate \" +\n-                            Topic.GROUP_METADATA_TOPIC_NAME));\n-                    } else if (!metadata.topic().equals(Topic.GROUP_METADATA_TOPIC_NAME)) {\n-                        metadataExceptions.add(new UnknownServerException(\"Server returned unrequested \" +\n-                            \"information about unexpected topic \" + metadata.topic()));\n-                    } else {\n-                        for (final MetadataResponse.PartitionMetadata partitionMetadata : metadata.partitionMetadata()) {\n-                            final Node leader = partitionMetadata.leader();\n-                            if (partitionMetadata.error() != Errors.NONE) {\n-                                // TODO: KAFKA-6789, retry based on the error code\n-                                metadataExceptions.add(partitionMetadata.error().exception(\"Unable to find \" +\n-                                    \"leader for partition \" + partitionMetadata.partition() + \" of \" +\n-                                    Topic.GROUP_METADATA_TOPIC_NAME));\n-                            } else if (leader == null || leader.equals(Node.noNode())) {\n-                                metadataExceptions.add(new LeaderNotAvailableException(\"Unable to find leader \" +\n-                                    \"for partition \" + partitionMetadata.partition() + \" of \" +\n-                                    Topic.GROUP_METADATA_TOPIC_NAME));\n-                            } else {\n-                                leaders.add(leader);\n-                            }\n-                        }\n-                    }\n-                }\n-                final ListConsumerGroupsResults results =\n-                    new ListConsumerGroupsResults(metadataExceptions, leaders, all);\n-                for (final Node node : leaders) {\n+                Cluster cluster = metadataResponse.cluster();\n+\n+                if (cluster.nodes().isEmpty())","path":"clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java","position":124,"original_position":124,"commit_id":"d7278241b2fd8c064e654d8f8a71ae1c44ea2964","original_commit_id":"eaa96e81762131dcc62d0b64c7ec7b044aba8ed8","user":{"login":"hachikuji","id":12502538,"avatar_url":"https://avatars3.githubusercontent.com/u/12502538?v=4","gravatar_id":"","url":"https://api.github.com/users/hachikuji","html_url":"https://github.com/hachikuji","followers_url":"https://api.github.com/users/hachikuji/followers","following_url":"https://api.github.com/users/hachikuji/following{/other_user}","gists_url":"https://api.github.com/users/hachikuji/gists{/gist_id}","starred_url":"https://api.github.com/users/hachikuji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachikuji/subscriptions","organizations_url":"https://api.github.com/users/hachikuji/orgs","repos_url":"https://api.github.com/users/hachikuji/repos","events_url":"https://api.github.com/users/hachikuji/events{/privacy}","received_events_url":"https://api.github.com/users/hachikuji/received_events","type":"User","site_admin":false},"body":"The purpose of the `StaleMetadataException` was basically just to trigger a retry (I need something which retriable). However, it's a good point that we might not want to expose this exception directly in the case of failure. I've submitted a patch which wraps it inside a generic `KafkaException`. I think it's probably better not to return anything too specific in this case initially since the implementation may change. Does that seem reasonable?","created_at":"2018-05-23T16:21:35Z","updated_at":"2018-05-23T16:21:36Z","html_url":"https://github.com/apache/kafka/pull/5007#discussion_r190313419","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/5007","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/190313419"},"html":{"href":"https://github.com/apache/kafka/pull/5007#discussion_r190313419"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/5007"}},"in_reply_to_id":190091133},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/5007","id":187506818,"html_url":"https://github.com/apache/kafka/pull/5007","diff_url":"https://github.com/apache/kafka/pull/5007.diff","patch_url":"https://github.com/apache/kafka/pull/5007.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/5007","number":5007,"state":"open","locked":false,"title":"MINOR: Remove dependence on __consumer_offsets in AdminClient listConsumerGroups","user":{"login":"hachikuji","id":12502538,"avatar_url":"https://avatars3.githubusercontent.com/u/12502538?v=4","gravatar_id":"","url":"https://api.github.com/users/hachikuji","html_url":"https://github.com/hachikuji","followers_url":"https://api.github.com/users/hachikuji/followers","following_url":"https://api.github.com/users/hachikuji/following{/other_user}","gists_url":"https://api.github.com/users/hachikuji/gists{/gist_id}","starred_url":"https://api.github.com/users/hachikuji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachikuji/subscriptions","organizations_url":"https://api.github.com/users/hachikuji/orgs","repos_url":"https://api.github.com/users/hachikuji/repos","events_url":"https://api.github.com/users/hachikuji/events{/privacy}","received_events_url":"https://api.github.com/users/hachikuji/received_events","type":"User","site_admin":false},"body":"Avoid dependence on the internal __consumer_offsets topic to handle `listConsumerGroups()` since it unnecessarily requires users to have Describe access on an internal topic. Instead we query each broker independently. For most clusters, this amounts to the same thing since the default number of partitions for __consumer_offsets is 50. This also provides better encapsulation since it avoids exposing the use of __consumer_offsets, which gives us more flexibility in the future.\r\n\r\n### Committer Checklist (excluded from commit message)\r\n- [ ] Verify design and implementation \r\n- [ ] Verify test coverage and CI build status\r\n- [ ] Verify documentation (including upgrade notes)\r\n","created_at":"2018-05-11T16:08:33Z","updated_at":"2018-05-23T16:21:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90f49ed54e61ca2f8a189e2409b61ee63f7a4d46","assignee":{"login":"lindong28","id":5873403,"avatar_url":"https://avatars0.githubusercontent.com/u/5873403?v=4","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"assignees":[{"login":"lindong28","id":5873403,"avatar_url":"https://avatars0.githubusercontent.com/u/5873403?v=4","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/5007/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/5007/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/5007/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/d7278241b2fd8c064e654d8f8a71ae1c44ea2964","head":{"label":"hachikuji:remove-admin-use-of-offsets-topic","ref":"remove-admin-use-of-offsets-topic","sha":"d7278241b2fd8c064e654d8f8a71ae1c44ea2964","user":{"login":"hachikuji","id":12502538,"avatar_url":"https://avatars3.githubusercontent.com/u/12502538?v=4","gravatar_id":"","url":"https://api.github.com/users/hachikuji","html_url":"https://github.com/hachikuji","followers_url":"https://api.github.com/users/hachikuji/followers","following_url":"https://api.github.com/users/hachikuji/following{/other_user}","gists_url":"https://api.github.com/users/hachikuji/gists{/gist_id}","starred_url":"https://api.github.com/users/hachikuji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachikuji/subscriptions","organizations_url":"https://api.github.com/users/hachikuji/orgs","repos_url":"https://api.github.com/users/hachikuji/repos","events_url":"https://api.github.com/users/hachikuji/events{/privacy}","received_events_url":"https://api.github.com/users/hachikuji/received_events","type":"User","site_admin":false},"repo":{"id":35842084,"name":"kafka","full_name":"hachikuji/kafka","owner":{"login":"hachikuji","id":12502538,"avatar_url":"https://avatars3.githubusercontent.com/u/12502538?v=4","gravatar_id":"","url":"https://api.github.com/users/hachikuji","html_url":"https://github.com/hachikuji","followers_url":"https://api.github.com/users/hachikuji/followers","following_url":"https://api.github.com/users/hachikuji/following{/other_user}","gists_url":"https://api.github.com/users/hachikuji/gists{/gist_id}","starred_url":"https://api.github.com/users/hachikuji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachikuji/subscriptions","organizations_url":"https://api.github.com/users/hachikuji/orgs","repos_url":"https://api.github.com/users/hachikuji/repos","events_url":"https://api.github.com/users/hachikuji/events{/privacy}","received_events_url":"https://api.github.com/users/hachikuji/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hachikuji/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/hachikuji/kafka","forks_url":"https://api.github.com/repos/hachikuji/kafka/forks","keys_url":"https://api.github.com/repos/hachikuji/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hachikuji/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hachikuji/kafka/teams","hooks_url":"https://api.github.com/repos/hachikuji/kafka/hooks","issue_events_url":"https://api.github.com/repos/hachikuji/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/hachikuji/kafka/events","assignees_url":"https://api.github.com/repos/hachikuji/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/hachikuji/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/hachikuji/kafka/tags","blobs_url":"https://api.github.com/repos/hachikuji/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hachikuji/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hachikuji/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/hachikuji/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hachikuji/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/hachikuji/kafka/languages","stargazers_url":"https://api.github.com/repos/hachikuji/kafka/stargazers","contributors_url":"https://api.github.com/repos/hachikuji/kafka/contributors","subscribers_url":"https://api.github.com/repos/hachikuji/kafka/subscribers","subscription_url":"https://api.github.com/repos/hachikuji/kafka/subscription","commits_url":"https://api.github.com/repos/hachikuji/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/hachikuji/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/hachikuji/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/hachikuji/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/hachikuji/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/hachikuji/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hachikuji/kafka/merges","archive_url":"https://api.github.com/repos/hachikuji/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hachikuji/kafka/downloads","issues_url":"https://api.github.com/repos/hachikuji/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/hachikuji/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/hachikuji/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/hachikuji/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hachikuji/kafka/labels{/name}","releases_url":"https://api.github.com/repos/hachikuji/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/hachikuji/kafka/deployments","created_at":"2015-05-18T20:54:26Z","updated_at":"2015-05-18T20:54:28Z","pushed_at":"2018-05-23T16:18:06Z","git_url":"git://github.com/hachikuji/kafka.git","ssh_url":"git@github.com:hachikuji/kafka.git","clone_url":"https://github.com/hachikuji/kafka.git","svn_url":"https://github.com/hachikuji/kafka","homepage":null,"size":69152,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"0.8.2"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"7ecfbab92fa0993a3046ff0c3d4fc69f319f13a3","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-05-23T14:57:00Z","pushed_at":"2018-05-23T16:18:15Z","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":65703,"stargazers_count":8420,"watchers_count":8420,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4885,"mirror_url":null,"archived":false,"open_issues_count":471,"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":4885,"open_issues":471,"watchers":8420,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/5007"},"html":{"href":"https://github.com/apache/kafka/pull/5007"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/5007"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/5007/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/5007/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/5007/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/d7278241b2fd8c064e654d8f8a71ae1c44ea2964"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hachikuji"}}