{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/189131757","pull_request_review_id":121252755,"id":189131757,"diff_hunk":"@@ -17,55 +17,96 @@\n \n package org.apache.kafka.clients.admin;\n \n+import org.apache.kafka.common.ConsumerGroupState;\n+import org.apache.kafka.common.Node;\n import org.apache.kafka.common.utils.Utils;\n \n-import java.util.List;\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.Collections;\n+import java.util.Objects;\n \n /**\n  * A detailed description of a single consumer group in the cluster.\n  */\n public class ConsumerGroupDescription {\n-\n     private final String groupId;\n     private final boolean isSimpleConsumerGroup;\n-    private final List<MemberDescription> members;\n+    private final Collection<MemberDescription> members;\n     private final String partitionAssignor;\n+    private final ConsumerGroupState state;\n+    private final Node coordinator;\n \n-    /**\n-     * Creates an instance with the specified parameters.\n-     *\n-     * @param groupId               The consumer group id\n-     * @param isSimpleConsumerGroup If Consumer Group is simple\n-     * @param members               The consumer group members\n-     * @param partitionAssignor     The consumer group partition assignor\n-     */\n-    public ConsumerGroupDescription(String groupId, boolean isSimpleConsumerGroup, List<MemberDescription> members, String partitionAssignor) {\n-        this.groupId = groupId;\n+    public static class Builder {","path":"clients/src/main/java/org/apache/kafka/clients/admin/ConsumerGroupDescription.java","position":37,"original_position":37,"commit_id":"f077f0c61543b7dc168135a92d7cb09da4f14c45","original_commit_id":"f077f0c61543b7dc168135a92d7cb09da4f14c45","user":{"login":"cmccabe","id":1095624,"avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"body":"> Curious if we use builders for any of the other admin object?\r\n\r\nI would argue the *Options classes (CreateTopicsOptions, etc.) are very similar to builders.  For example, you can use CreateTopicsOptions like this:  `new CreateTopicsOptions().timeoutMs(10000).validateOnly(true)`  This is useful to let the options evolve over time.\r\n\r\nI think `ConsumerGroupDescription` will almost certainly get new fields over time, so some of the same concerns apply here (although it's less urgent if the constructor is not public)\r\n\r\n> Does it need to be public?\r\n\r\nI guess we can make it package-private for now.  Code that needs this for unit tests could use  `MockAdminClient`.","created_at":"2018-05-17T23:45:36Z","updated_at":"2018-05-17T23:45:36Z","html_url":"https://github.com/apache/kafka/pull/4980#discussion_r189131757","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/4980","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/189131757"},"html":{"href":"https://github.com/apache/kafka/pull/4980#discussion_r189131757"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/4980"}},"in_reply_to_id":189043666},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/4980","id":186790146,"html_url":"https://github.com/apache/kafka/pull/4980","diff_url":"https://github.com/apache/kafka/pull/4980.diff","patch_url":"https://github.com/apache/kafka/pull/4980.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/4980","number":4980,"state":"open","locked":false,"title":"KAFKA-6868: Fix buffer underflow and expose group state in the consumer groups API","user":{"login":"cmccabe","id":1095624,"avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"body":"* The consumer groups API should expose group state.  This information is needed by administrative tools and scripts that access consume groups.\r\n\r\n* The partition assignment will be empty when the group is rebalancing. Fix an issue where the adminclient attempted to deserialize this empty buffer.\r\n\r\n* Remove nulls from the API and make all collections immutable.\r\n\r\n* DescribeConsumerGroupsResult#all should return a result as expected, rather than Void\r\n\r\n* Add Builder classes for MemberDescription and ConsumerGroupDescription, so that we can easily add new fields later without having a large number of constructors.\r\n\r\n* Fix exception text for GroupIdNotFoundException, GroupNotEmptyException. It was being filled in as\r\n\"The group id The group id does not exist was not found\" and similar.\r\n\r\n* Add integration test","created_at":"2018-05-09T00:33:07Z","updated_at":"2018-05-17T23:45:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c89a8f620df1d499a61d7f8189f575cb58bfe6e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/4980/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/4980/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/4980/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/f077f0c61543b7dc168135a92d7cb09da4f14c45","head":{"label":"cmccabe:fix_consumer_groups_api","ref":"fix_consumer_groups_api","sha":"f077f0c61543b7dc168135a92d7cb09da4f14c45","user":{"login":"cmccabe","id":1095624,"avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"repo":{"id":74628042,"name":"kafka","full_name":"cmccabe/kafka","owner":{"login":"cmccabe","id":1095624,"avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmccabe/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/cmccabe/kafka","forks_url":"https://api.github.com/repos/cmccabe/kafka/forks","keys_url":"https://api.github.com/repos/cmccabe/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmccabe/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmccabe/kafka/teams","hooks_url":"https://api.github.com/repos/cmccabe/kafka/hooks","issue_events_url":"https://api.github.com/repos/cmccabe/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/cmccabe/kafka/events","assignees_url":"https://api.github.com/repos/cmccabe/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/cmccabe/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/cmccabe/kafka/tags","blobs_url":"https://api.github.com/repos/cmccabe/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmccabe/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmccabe/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmccabe/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmccabe/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/cmccabe/kafka/languages","stargazers_url":"https://api.github.com/repos/cmccabe/kafka/stargazers","contributors_url":"https://api.github.com/repos/cmccabe/kafka/contributors","subscribers_url":"https://api.github.com/repos/cmccabe/kafka/subscribers","subscription_url":"https://api.github.com/repos/cmccabe/kafka/subscription","commits_url":"https://api.github.com/repos/cmccabe/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmccabe/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmccabe/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmccabe/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmccabe/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/cmccabe/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmccabe/kafka/merges","archive_url":"https://api.github.com/repos/cmccabe/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmccabe/kafka/downloads","issues_url":"https://api.github.com/repos/cmccabe/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/cmccabe/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/cmccabe/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/cmccabe/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmccabe/kafka/labels{/name}","releases_url":"https://api.github.com/repos/cmccabe/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/cmccabe/kafka/deployments","created_at":"2016-11-24T01:40:33Z","updated_at":"2016-11-24T01:40:38Z","pushed_at":"2018-05-17T17:33:58Z","git_url":"git://github.com/cmccabe/kafka.git","ssh_url":"git@github.com:cmccabe/kafka.git","clone_url":"https://github.com/cmccabe/kafka.git","svn_url":"https://github.com/cmccabe/kafka","homepage":null,"size":65144,"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":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":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"1e207b2ef83db4296fb944ade4c301794f9e8460","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-17T18:57:48Z","pushed_at":"2018-05-17T23:10:44Z","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":65531,"stargazers_count":8355,"watchers_count":8355,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4860,"mirror_url":null,"archived":false,"open_issues_count":461,"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":4860,"open_issues":461,"watchers":8355,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/4980"},"html":{"href":"https://github.com/apache/kafka/pull/4980"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/4980"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/4980/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/4980/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/4980/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/f077f0c61543b7dc168135a92d7cb09da4f14c45"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cmccabe"}}