{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/comments/54107360","id":54107360,"diff_hunk":"@@ -0,0 +1,170 @@\n+require \"set\"\n+require \"kafka/protocol/member_assignment\"\n+\n+module Kafka\n+  class ConsumerGroup\n+    attr_reader :assigned_partitions\n+\n+    def initialize(cluster:, logger:, group_id:)\n+      @cluster = cluster\n+      @logger = logger\n+      @group_id = group_id\n+      @session_timeout = 30","path":"lib/kafka/consumer_group.rb","position":12,"original_position":12,"commit_id":"c29f1b94a1006334fd3df46b613c193e7fdae425","original_commit_id":"c29f1b94a1006334fd3df46b613c193e7fdae425","user":{"login":"dasch","id":6351,"avatar_url":"https://avatars.githubusercontent.com/u/6351?v=3","gravatar_id":"","url":"https://api.github.com/users/dasch","html_url":"https://github.com/dasch","followers_url":"https://api.github.com/users/dasch/followers","following_url":"https://api.github.com/users/dasch/following{/other_user}","gists_url":"https://api.github.com/users/dasch/gists{/gist_id}","starred_url":"https://api.github.com/users/dasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasch/subscriptions","organizations_url":"https://api.github.com/users/dasch/orgs","repos_url":"https://api.github.com/users/dasch/repos","events_url":"https://api.github.com/users/dasch/events{/privacy}","received_events_url":"https://api.github.com/users/dasch/received_events","type":"User","site_admin":false},"body":"Definitely – this is a use case specific tradeoff. Will make it configurable later and add some docs.","created_at":"2016-02-25T15:01:43Z","updated_at":"2016-02-25T15:01:43Z","html_url":"https://github.com/zendesk/ruby-kafka/pull/99#discussion_r54107360","pull_request_url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/comments/54107360"},"html":{"href":"https://github.com/zendesk/ruby-kafka/pull/99#discussion_r54107360"},"pull_request":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99","id":60509879,"html_url":"https://github.com/zendesk/ruby-kafka/pull/99","diff_url":"https://github.com/zendesk/ruby-kafka/pull/99.diff","patch_url":"https://github.com/zendesk/ruby-kafka/pull/99.patch","issue_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/99","number":99,"state":"open","locked":false,"title":"Implement Consumer Group API","user":{"login":"dasch","id":6351,"avatar_url":"https://avatars.githubusercontent.com/u/6351?v=3","gravatar_id":"","url":"https://api.github.com/users/dasch","html_url":"https://github.com/dasch","followers_url":"https://api.github.com/users/dasch/followers","following_url":"https://api.github.com/users/dasch/following{/other_user}","gists_url":"https://api.github.com/users/dasch/gists{/gist_id}","starred_url":"https://api.github.com/users/dasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasch/subscriptions","organizations_url":"https://api.github.com/users/dasch/orgs","repos_url":"https://api.github.com/users/dasch/repos","events_url":"https://api.github.com/users/dasch/events{/privacy}","received_events_url":"https://api.github.com/users/dasch/received_events","type":"User","site_admin":false},"body":"This is still very _very_ alpha level.\r\n\r\nThe consumer group API is very generic and therefore somewhat hard to grok. It's basically a general-purpose coordination API, with the consumer group API being a sub-protocol. The clients themselves are responsible for assigning partitions among themselves; one is selected as the leader for a specific generation and sends a list of member -> partitions assignments to the Kafka broker. This allows the clients to control assignment policies, but also makes it a bit more upfront work.\r\n\r\n###### Tasks\r\n\r\n- [x] Ensure heartbeats are sent periodically.\r\n- [x] ~~Figure out a threading model that isn't too difficult to work with.~~ screw that, let's just keep everything synchronous for now.\r\n- [x] Handle rebalances.\r\n- [x] Fetch and commit offsets.","created_at":"2016-02-24T13:39:35Z","updated_at":"2016-02-25T15:01:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f34ab370dffd04034e1855afde7bd3f57a1a76e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99/commits","review_comments_url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99/comments","review_comment_url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/99/comments","statuses_url":"https://api.github.com/repos/zendesk/ruby-kafka/statuses/c29f1b94a1006334fd3df46b613c193e7fdae425","head":{"label":"zendesk:dasch/consumer-groups","ref":"dasch/consumer-groups","sha":"c29f1b94a1006334fd3df46b613c193e7fdae425","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":49878403,"name":"ruby-kafka","full_name":"zendesk/ruby-kafka","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/ruby-kafka","description":"A Ruby client library for the Kafka distributed log system","fork":false,"url":"https://api.github.com/repos/zendesk/ruby-kafka","forks_url":"https://api.github.com/repos/zendesk/ruby-kafka/forks","keys_url":"https://api.github.com/repos/zendesk/ruby-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/ruby-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/ruby-kafka/teams","hooks_url":"https://api.github.com/repos/zendesk/ruby-kafka/hooks","issue_events_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/ruby-kafka/events","assignees_url":"https://api.github.com/repos/zendesk/ruby-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/ruby-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/ruby-kafka/tags","blobs_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/ruby-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/ruby-kafka/languages","stargazers_url":"https://api.github.com/repos/zendesk/ruby-kafka/stargazers","contributors_url":"https://api.github.com/repos/zendesk/ruby-kafka/contributors","subscribers_url":"https://api.github.com/repos/zendesk/ruby-kafka/subscribers","subscription_url":"https://api.github.com/repos/zendesk/ruby-kafka/subscription","commits_url":"https://api.github.com/repos/zendesk/ruby-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/ruby-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/ruby-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/ruby-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/ruby-kafka/merges","archive_url":"https://api.github.com/repos/zendesk/ruby-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/ruby-kafka/downloads","issues_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/ruby-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/ruby-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/ruby-kafka/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/ruby-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/ruby-kafka/deployments","created_at":"2016-01-18T13:24:55Z","updated_at":"2016-02-24T05:29:33Z","pushed_at":"2016-02-25T14:31:36Z","git_url":"git://github.com/zendesk/ruby-kafka.git","ssh_url":"git@github.com:zendesk/ruby-kafka.git","clone_url":"https://github.com/zendesk/ruby-kafka.git","svn_url":"https://github.com/zendesk/ruby-kafka","homepage":"http://www.rubydoc.info/github/zendesk/ruby-kafka","size":363,"stargazers_count":123,"watchers_count":123,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":123,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"5a9df79240c40fdbb1948450e50b7ad3e78ccac2","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":49878403,"name":"ruby-kafka","full_name":"zendesk/ruby-kafka","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/ruby-kafka","description":"A Ruby client library for the Kafka distributed log system","fork":false,"url":"https://api.github.com/repos/zendesk/ruby-kafka","forks_url":"https://api.github.com/repos/zendesk/ruby-kafka/forks","keys_url":"https://api.github.com/repos/zendesk/ruby-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/ruby-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/ruby-kafka/teams","hooks_url":"https://api.github.com/repos/zendesk/ruby-kafka/hooks","issue_events_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/ruby-kafka/events","assignees_url":"https://api.github.com/repos/zendesk/ruby-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/ruby-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/ruby-kafka/tags","blobs_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/ruby-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/ruby-kafka/languages","stargazers_url":"https://api.github.com/repos/zendesk/ruby-kafka/stargazers","contributors_url":"https://api.github.com/repos/zendesk/ruby-kafka/contributors","subscribers_url":"https://api.github.com/repos/zendesk/ruby-kafka/subscribers","subscription_url":"https://api.github.com/repos/zendesk/ruby-kafka/subscription","commits_url":"https://api.github.com/repos/zendesk/ruby-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/ruby-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/ruby-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/ruby-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/ruby-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/ruby-kafka/merges","archive_url":"https://api.github.com/repos/zendesk/ruby-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/ruby-kafka/downloads","issues_url":"https://api.github.com/repos/zendesk/ruby-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/ruby-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/ruby-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/ruby-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/ruby-kafka/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/ruby-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/ruby-kafka/deployments","created_at":"2016-01-18T13:24:55Z","updated_at":"2016-02-24T05:29:33Z","pushed_at":"2016-02-25T14:31:36Z","git_url":"git://github.com/zendesk/ruby-kafka.git","ssh_url":"git@github.com:zendesk/ruby-kafka.git","clone_url":"https://github.com/zendesk/ruby-kafka.git","svn_url":"https://github.com/zendesk/ruby-kafka","homepage":"http://www.rubydoc.info/github/zendesk/ruby-kafka","size":363,"stargazers_count":123,"watchers_count":123,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99"},"html":{"href":"https://github.com/zendesk/ruby-kafka/pull/99"},"issue":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/issues/99"},"comments":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/ruby-kafka/statuses/c29f1b94a1006334fd3df46b613c193e7fdae425"}}}}