{"action":"created","comment":{"url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/comments/132562013","pull_request_review_id":55658454,"id":132562013,"diff_hunk":"@@ -0,0 +1,53 @@\n+package batchconsumer\n+\n+import (\n+\t\"fmt\"\n+\t\"time\"\n+\n+\t\"github.com/Clever/amazon-kinesis-client-go/kcl\"\n+)\n+\n+var ErrBatchFull = fmt.Errorf(\"The batch is full\")\n+\n+type batcher struct {\n+\tflushCount int\n+\tflushSize  int\n+\n+\tBatch       [][]byte\n+\tLastUpdated time.Time\n+\tSmallestSeq kcl.SequencePair\n+}\n+\n+func (b *batcher) batchSize(batch [][]byte) int {\n+\ttotal := 0\n+\tfor _, msg := range batch {\n+\t\ttotal += len(msg)\n+\t}\n+\n+\treturn total\n+}\n+\n+func (b *batcher) AddMessage(msg []byte, pair kcl.SequencePair) error {","path":"batchconsumer/batcher.go","position":30,"original_position":30,"commit_id":"55aeecddd75ede227cffdc7fa2a73fd7aab35198","original_commit_id":"b7743c9ea7f1312064a8c24da560ff8f5c447273","user":{"login":"xavi-","id":75434,"avatar_url":"https://avatars2.githubusercontent.com/u/75434?v=4","gravatar_id":"","url":"https://api.github.com/users/xavi-","html_url":"https://github.com/xavi-","followers_url":"https://api.github.com/users/xavi-/followers","following_url":"https://api.github.com/users/xavi-/following{/other_user}","gists_url":"https://api.github.com/users/xavi-/gists{/gist_id}","starred_url":"https://api.github.com/users/xavi-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavi-/subscriptions","organizations_url":"https://api.github.com/users/xavi-/orgs","repos_url":"https://api.github.com/users/xavi-/repos","events_url":"https://api.github.com/users/xavi-/events{/privacy}","received_events_url":"https://api.github.com/users/xavi-/received_events","type":"User","site_admin":false},"body":"The idea was to distinguish it from `batchSize`.  While `AddMessage` is expected to be used outside of this file, `batchSize` is not.","created_at":"2017-08-10T20:40:47Z","updated_at":"2017-08-10T20:40:47Z","html_url":"https://github.com/Clever/amazon-kinesis-client-go/pull/6#discussion_r132562013","pull_request_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/comments/132562013"},"html":{"href":"https://github.com/Clever/amazon-kinesis-client-go/pull/6#discussion_r132562013"},"pull_request":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6","id":134546732,"html_url":"https://github.com/Clever/amazon-kinesis-client-go/pull/6","diff_url":"https://github.com/Clever/amazon-kinesis-client-go/pull/6.diff","patch_url":"https://github.com/Clever/amazon-kinesis-client-go/pull/6.patch","issue_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/6","number":6,"state":"open","locked":false,"title":"Made batchedconsumer interface production ready","user":{"login":"xavi-","id":75434,"avatar_url":"https://avatars2.githubusercontent.com/u/75434?v=4","gravatar_id":"","url":"https://api.github.com/users/xavi-","html_url":"https://github.com/xavi-","followers_url":"https://api.github.com/users/xavi-/followers","following_url":"https://api.github.com/users/xavi-/following{/other_user}","gists_url":"https://api.github.com/users/xavi-/gists{/gist_id}","starred_url":"https://api.github.com/users/xavi-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavi-/subscriptions","organizations_url":"https://api.github.com/users/xavi-/orgs","repos_url":"https://api.github.com/users/xavi-/repos","events_url":"https://api.github.com/users/xavi-/events{/privacy}","received_events_url":"https://api.github.com/users/xavi-/received_events","type":"User","site_admin":false},"body":"This PR contains numerous refactors layered on top of another.  The public interface ask defined in https://github.com/Clever/amazon-kinesis-client-go/pull/5 hasn't changed.  I recommend **not** to look at this PR commit by commit. \r\n\r\n Jira:\r\n- https://clever.atlassian.net/browse/INFRA-2260\r\n- https://clever.atlassian.net/browse/INFRA-2433 (decoder changes should fix this)\r\n","created_at":"2017-08-07T23:23:18Z","updated_at":"2017-08-10T20:40:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d25292679ac127393458f0e6c7c65ebfed1e0b8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6/commits","review_comments_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6/comments","review_comment_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/6/comments","statuses_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/statuses/55aeecddd75ede227cffdc7fa2a73fd7aab35198","head":{"label":"Clever:INFRA-2405-new-consumer-interface","ref":"INFRA-2405-new-consumer-interface","sha":"55aeecddd75ede227cffdc7fa2a73fd7aab35198","user":{"login":"Clever","id":1885509,"avatar_url":"https://avatars1.githubusercontent.com/u/1885509?v=4","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"repo":{"id":81370555,"name":"amazon-kinesis-client-go","full_name":"Clever/amazon-kinesis-client-go","owner":{"login":"Clever","id":1885509,"avatar_url":"https://avatars1.githubusercontent.com/u/1885509?v=4","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Clever/amazon-kinesis-client-go","description":"Amazon Kinesis Client for Go","fork":false,"url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go","forks_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/forks","keys_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/teams","hooks_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/hooks","issue_events_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/events{/number}","events_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/events","assignees_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/assignees{/user}","branches_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/branches{/branch}","tags_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/tags","blobs_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/statuses/{sha}","languages_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/languages","stargazers_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/stargazers","contributors_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/contributors","subscribers_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/subscribers","subscription_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/subscription","commits_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/contents/{+path}","compare_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/merges","archive_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/downloads","issues_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues{/number}","pulls_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls{/number}","milestones_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/milestones{/number}","notifications_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/labels{/name}","releases_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/releases{/id}","deployments_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/deployments","created_at":"2017-02-08T20:03:06Z","updated_at":"2017-07-29T00:48:03Z","pushed_at":"2017-08-10T20:39:09Z","git_url":"git://github.com/Clever/amazon-kinesis-client-go.git","ssh_url":"git@github.com:Clever/amazon-kinesis-client-go.git","clone_url":"https://github.com/Clever/amazon-kinesis-client-go.git","svn_url":"https://github.com/Clever/amazon-kinesis-client-go","homepage":null,"size":75,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"Clever:master","ref":"master","sha":"4c6d8453efd75d4140edc73959da735f6e72ef98","user":{"login":"Clever","id":1885509,"avatar_url":"https://avatars1.githubusercontent.com/u/1885509?v=4","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"repo":{"id":81370555,"name":"amazon-kinesis-client-go","full_name":"Clever/amazon-kinesis-client-go","owner":{"login":"Clever","id":1885509,"avatar_url":"https://avatars1.githubusercontent.com/u/1885509?v=4","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Clever/amazon-kinesis-client-go","description":"Amazon Kinesis Client for Go","fork":false,"url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go","forks_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/forks","keys_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/teams","hooks_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/hooks","issue_events_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/events{/number}","events_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/events","assignees_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/assignees{/user}","branches_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/branches{/branch}","tags_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/tags","blobs_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/statuses/{sha}","languages_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/languages","stargazers_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/stargazers","contributors_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/contributors","subscribers_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/subscribers","subscription_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/subscription","commits_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/contents/{+path}","compare_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/merges","archive_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/downloads","issues_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues{/number}","pulls_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls{/number}","milestones_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/milestones{/number}","notifications_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/labels{/name}","releases_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/releases{/id}","deployments_url":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/deployments","created_at":"2017-02-08T20:03:06Z","updated_at":"2017-07-29T00:48:03Z","pushed_at":"2017-08-10T20:39:09Z","git_url":"git://github.com/Clever/amazon-kinesis-client-go.git","ssh_url":"git@github.com:Clever/amazon-kinesis-client-go.git","clone_url":"https://github.com/Clever/amazon-kinesis-client-go.git","svn_url":"https://github.com/Clever/amazon-kinesis-client-go","homepage":null,"size":75,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6"},"html":{"href":"https://github.com/Clever/amazon-kinesis-client-go/pull/6"},"issue":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/6"},"comments":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/Clever/amazon-kinesis-client-go/statuses/55aeecddd75ede227cffdc7fa2a73fd7aab35198"}}}}
{"actor":{"display_login":"xavi-"}}