{"action":"closed","number":348,"pull_request":{"url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/348","id":142936439,"node_id":"MDExOlB1bGxSZXF1ZXN0MTQyOTM2NDM5","html_url":"https://github.com/aws-amplify/aws-sdk-android/pull/348","diff_url":"https://github.com/aws-amplify/aws-sdk-android/pull/348.diff","patch_url":"https://github.com/aws-amplify/aws-sdk-android/pull/348.patch","issue_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues/348","number":348,"state":"closed","locked":false,"title":"Optimize Kinesis for multiple mixed stream records (Fix Issue #340)","user":{"login":"alevkov","id":8249463,"node_id":"MDQ6VXNlcjgyNDk0NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8249463?v=4","gravatar_id":"","url":"https://api.github.com/users/alevkov","html_url":"https://github.com/alevkov","followers_url":"https://api.github.com/users/alevkov/followers","following_url":"https://api.github.com/users/alevkov/following{/other_user}","gists_url":"https://api.github.com/users/alevkov/gists{/gist_id}","starred_url":"https://api.github.com/users/alevkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alevkov/subscriptions","organizations_url":"https://api.github.com/users/alevkov/orgs","repos_url":"https://api.github.com/users/alevkov/repos","events_url":"https://api.github.com/users/alevkov/events{/privacy}","received_events_url":"https://api.github.com/users/alevkov/received_events","type":"User","site_admin":false},"body":"**Issue**\r\n\r\nKinesis Firehose takes a very long time to batch and submit records when records from multiple streams are mixed in the record store.\r\n\r\n**Description**\r\n\r\nOur Android client is submitting data to 14 different Firehose streams. The records are saved into the Kinesis recordStore as soon as they're generated. This result in a fragmented recordStore (i.e. 3 records from stream1, followed by 1 record from stream2, followed by 2 records from stream3).\r\n\r\nThe way submitAll() works is that it batches consecutive records belonging to one stream, submits them, then grabs the next batch of consecutive records belonging to another stream. This works well when the records are sorted by stream name. But as one can image, in a fragmented record store, this produces a lot of batches with very few records. This causes submitAllRecords() to run for a long time consuming device CPU and power, and very little bandwidth. In our case, it can run for more than an hour.\r\n\r\n**Offered Solution**\r\n\r\nWe can minimize the number of batches being sent by grouping records of the same stream together before sending. We can do so efficiently by iterating through the records in the recordStore and saving them in a batch buffer according to their respective stream. Once the maximum batch size is reached for any of the stream batches, it gets submitted.","created_at":"2017-09-25T17:09:46Z","updated_at":"2018-12-11T22:48:32Z","closed_at":"2018-12-11T22:48:32Z","merged_at":null,"merge_commit_sha":"2529e1b66f4c1d3df33d98e68fb67ccd70c169f5","assignee":{"login":"desokroshan","id":4340938,"node_id":"MDQ6VXNlcjQzNDA5Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/4340938?v=4","gravatar_id":"","url":"https://api.github.com/users/desokroshan","html_url":"https://github.com/desokroshan","followers_url":"https://api.github.com/users/desokroshan/followers","following_url":"https://api.github.com/users/desokroshan/following{/other_user}","gists_url":"https://api.github.com/users/desokroshan/gists{/gist_id}","starred_url":"https://api.github.com/users/desokroshan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desokroshan/subscriptions","organizations_url":"https://api.github.com/users/desokroshan/orgs","repos_url":"https://api.github.com/users/desokroshan/repos","events_url":"https://api.github.com/users/desokroshan/events{/privacy}","received_events_url":"https://api.github.com/users/desokroshan/received_events","type":"User","site_admin":false},"assignees":[{"login":"desokroshan","id":4340938,"node_id":"MDQ6VXNlcjQzNDA5Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/4340938?v=4","gravatar_id":"","url":"https://api.github.com/users/desokroshan","html_url":"https://github.com/desokroshan","followers_url":"https://api.github.com/users/desokroshan/followers","following_url":"https://api.github.com/users/desokroshan/following{/other_user}","gists_url":"https://api.github.com/users/desokroshan/gists{/gist_id}","starred_url":"https://api.github.com/users/desokroshan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desokroshan/subscriptions","organizations_url":"https://api.github.com/users/desokroshan/orgs","repos_url":"https://api.github.com/users/desokroshan/repos","events_url":"https://api.github.com/users/desokroshan/events{/privacy}","received_events_url":"https://api.github.com/users/desokroshan/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":690773363,"node_id":"MDU6TGFiZWw2OTA3NzMzNjM=","url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/labels/Kinesis","name":"Kinesis","color":"1d76db","default":false},{"id":1072888026,"node_id":"MDU6TGFiZWwxMDcyODg4MDI2","url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/labels/pull%20request","name":"pull request","color":"61f4b5","default":false},{"id":690772982,"node_id":"MDU6TGFiZWw2OTA3NzI5ODI=","url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/labels/requesting%20feedback","name":"requesting feedback","color":"32c11f","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/348/commits","review_comments_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/348/comments","review_comment_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues/348/comments","statuses_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/statuses/8485d0279cb452b5ee35f8f0803673b7211eb2eb","head":{"label":"twosense:master","ref":"master","sha":"8485d0279cb452b5ee35f8f0803673b7211eb2eb","user":{"login":"twosense","id":20050808,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMDUwODA4","avatar_url":"https://avatars2.githubusercontent.com/u/20050808?v=4","gravatar_id":"","url":"https://api.github.com/users/twosense","html_url":"https://github.com/twosense","followers_url":"https://api.github.com/users/twosense/followers","following_url":"https://api.github.com/users/twosense/following{/other_user}","gists_url":"https://api.github.com/users/twosense/gists{/gist_id}","starred_url":"https://api.github.com/users/twosense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosense/subscriptions","organizations_url":"https://api.github.com/users/twosense/orgs","repos_url":"https://api.github.com/users/twosense/repos","events_url":"https://api.github.com/users/twosense/events{/privacy}","received_events_url":"https://api.github.com/users/twosense/received_events","type":"Organization","site_admin":false},"repo":{"id":102890029,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI4OTAwMjk=","name":"aws-sdk-android","full_name":"twosense/aws-sdk-android","private":false,"owner":{"login":"twosense","id":20050808,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMDUwODA4","avatar_url":"https://avatars2.githubusercontent.com/u/20050808?v=4","gravatar_id":"","url":"https://api.github.com/users/twosense","html_url":"https://github.com/twosense","followers_url":"https://api.github.com/users/twosense/followers","following_url":"https://api.github.com/users/twosense/following{/other_user}","gists_url":"https://api.github.com/users/twosense/gists{/gist_id}","starred_url":"https://api.github.com/users/twosense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosense/subscriptions","organizations_url":"https://api.github.com/users/twosense/orgs","repos_url":"https://api.github.com/users/twosense/repos","events_url":"https://api.github.com/users/twosense/events{/privacy}","received_events_url":"https://api.github.com/users/twosense/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/twosense/aws-sdk-android","description":"Official mirror of version 2 of the AWS Mobile SDK for Android. For more information, see our web site:","fork":true,"url":"https://api.github.com/repos/twosense/aws-sdk-android","forks_url":"https://api.github.com/repos/twosense/aws-sdk-android/forks","keys_url":"https://api.github.com/repos/twosense/aws-sdk-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twosense/aws-sdk-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twosense/aws-sdk-android/teams","hooks_url":"https://api.github.com/repos/twosense/aws-sdk-android/hooks","issue_events_url":"https://api.github.com/repos/twosense/aws-sdk-android/issues/events{/number}","events_url":"https://api.github.com/repos/twosense/aws-sdk-android/events","assignees_url":"https://api.github.com/repos/twosense/aws-sdk-android/assignees{/user}","branches_url":"https://api.github.com/repos/twosense/aws-sdk-android/branches{/branch}","tags_url":"https://api.github.com/repos/twosense/aws-sdk-android/tags","blobs_url":"https://api.github.com/repos/twosense/aws-sdk-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twosense/aws-sdk-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twosense/aws-sdk-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/twosense/aws-sdk-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twosense/aws-sdk-android/statuses/{sha}","languages_url":"https://api.github.com/repos/twosense/aws-sdk-android/languages","stargazers_url":"https://api.github.com/repos/twosense/aws-sdk-android/stargazers","contributors_url":"https://api.github.com/repos/twosense/aws-sdk-android/contributors","subscribers_url":"https://api.github.com/repos/twosense/aws-sdk-android/subscribers","subscription_url":"https://api.github.com/repos/twosense/aws-sdk-android/subscription","commits_url":"https://api.github.com/repos/twosense/aws-sdk-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/twosense/aws-sdk-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/twosense/aws-sdk-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/twosense/aws-sdk-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/twosense/aws-sdk-android/contents/{+path}","compare_url":"https://api.github.com/repos/twosense/aws-sdk-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twosense/aws-sdk-android/merges","archive_url":"https://api.github.com/repos/twosense/aws-sdk-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twosense/aws-sdk-android/downloads","issues_url":"https://api.github.com/repos/twosense/aws-sdk-android/issues{/number}","pulls_url":"https://api.github.com/repos/twosense/aws-sdk-android/pulls{/number}","milestones_url":"https://api.github.com/repos/twosense/aws-sdk-android/milestones{/number}","notifications_url":"https://api.github.com/repos/twosense/aws-sdk-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twosense/aws-sdk-android/labels{/name}","releases_url":"https://api.github.com/repos/twosense/aws-sdk-android/releases{/id}","deployments_url":"https://api.github.com/repos/twosense/aws-sdk-android/deployments","created_at":"2017-09-08T18:00:37Z","updated_at":"2018-11-07T18:21:57Z","pushed_at":"2017-09-25T17:03:58Z","git_url":"git://github.com/twosense/aws-sdk-android.git","ssh_url":"git@github.com:twosense/aws-sdk-android.git","clone_url":"https://github.com/twosense/aws-sdk-android.git","svn_url":"https://github.com/twosense/aws-sdk-android","homepage":"http://aws.amazon.com/mobile/sdk/","size":20304,"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":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aws-amplify:master","ref":"master","sha":"1d492dc7d8ad37a14596ddc337ba1a0733ec1182","user":{"login":"aws-amplify","id":41077760,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDc3NzYw","avatar_url":"https://avatars0.githubusercontent.com/u/41077760?v=4","gravatar_id":"","url":"https://api.github.com/users/aws-amplify","html_url":"https://github.com/aws-amplify","followers_url":"https://api.github.com/users/aws-amplify/followers","following_url":"https://api.github.com/users/aws-amplify/following{/other_user}","gists_url":"https://api.github.com/users/aws-amplify/gists{/gist_id}","starred_url":"https://api.github.com/users/aws-amplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws-amplify/subscriptions","organizations_url":"https://api.github.com/users/aws-amplify/orgs","repos_url":"https://api.github.com/users/aws-amplify/repos","events_url":"https://api.github.com/users/aws-amplify/events{/privacy}","received_events_url":"https://api.github.com/users/aws-amplify/received_events","type":"Organization","site_admin":false},"repo":{"id":21634100,"node_id":"MDEwOlJlcG9zaXRvcnkyMTYzNDEwMA==","name":"aws-sdk-android","full_name":"aws-amplify/aws-sdk-android","private":false,"owner":{"login":"aws-amplify","id":41077760,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDc3NzYw","avatar_url":"https://avatars0.githubusercontent.com/u/41077760?v=4","gravatar_id":"","url":"https://api.github.com/users/aws-amplify","html_url":"https://github.com/aws-amplify","followers_url":"https://api.github.com/users/aws-amplify/followers","following_url":"https://api.github.com/users/aws-amplify/following{/other_user}","gists_url":"https://api.github.com/users/aws-amplify/gists{/gist_id}","starred_url":"https://api.github.com/users/aws-amplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws-amplify/subscriptions","organizations_url":"https://api.github.com/users/aws-amplify/orgs","repos_url":"https://api.github.com/users/aws-amplify/repos","events_url":"https://api.github.com/users/aws-amplify/events{/privacy}","received_events_url":"https://api.github.com/users/aws-amplify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aws-amplify/aws-sdk-android","description":"AWS SDK for Android. For more information, see our web site:","fork":false,"url":"https://api.github.com/repos/aws-amplify/aws-sdk-android","forks_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/forks","keys_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/teams","hooks_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/hooks","issue_events_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues/events{/number}","events_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/events","assignees_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/assignees{/user}","branches_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/branches{/branch}","tags_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/tags","blobs_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/statuses/{sha}","languages_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/languages","stargazers_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/stargazers","contributors_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/contributors","subscribers_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/subscribers","subscription_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/subscription","commits_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/contents/{+path}","compare_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/merges","archive_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/downloads","issues_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues{/number}","pulls_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls{/number}","milestones_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/milestones{/number}","notifications_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/labels{/name}","releases_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/releases{/id}","deployments_url":"https://api.github.com/repos/aws-amplify/aws-sdk-android/deployments","created_at":"2014-07-09T00:44:24Z","updated_at":"2018-12-11T05:54:31Z","pushed_at":"2018-12-11T18:21:57Z","git_url":"git://github.com/aws-amplify/aws-sdk-android.git","ssh_url":"git@github.com:aws-amplify/aws-sdk-android.git","clone_url":"https://github.com/aws-amplify/aws-sdk-android.git","svn_url":"https://github.com/aws-amplify/aws-sdk-android","homepage":"https://aws-amplify.github.io/docs","size":119167,"stargazers_count":537,"watchers_count":537,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":315,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":315,"open_issues":50,"watchers":537,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/348"},"html":{"href":"https://github.com/aws-amplify/aws-sdk-android/pull/348"},"issue":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues/348"},"comments":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/aws-amplify/aws-sdk-android/statuses/8485d0279cb452b5ee35f8f0803673b7211eb2eb"}},"author_association":"NONE","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":13,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":271,"deletions":50,"changed_files":4}}
{"actor":{"display_login":"muellerfr"}}