{"action":"created","comment":{"url":"https://api.github.com/repos/wikimedia/restbase/pulls/comments/52251910","id":52251910,"diff_hunk":"@@ -218,13 +195,16 @@ ChunkedBucket.prototype._getMetadata = function(hyper, req) {\n ChunkedBucket.prototype.getRevision = function(hyper, req) {\n     var rp = req.params;\n     var self = this;\n+    var chunksTable = self._chunksTableName(req);\n+    var chunkURI = new URI([rp.domain, 'sys', 'table', chunksTable, '']);\n     return this._getMetadata(hyper, req)\n     .then(function(metadata) {\n-        return P.all(range(metadata.num_chunks).map(function(chunkId) {\n+        var byteStream = new stream.PassThrough();\n+        P.each(range(metadata.num_chunks), function(chunkId) {","path":"sys/key_rev_large_value.js","position":76,"original_position":76,"commit_id":"2a1e4a4e6ef16c9f935df8c46a896cce11e20e81","original_commit_id":"03597f572efd76cc4b63f52deb919099e993a13d","user":{"login":"d00rman","id":10210173,"avatar_url":"https://avatars.githubusercontent.com/u/10210173?v=3","gravatar_id":"","url":"https://api.github.com/users/d00rman","html_url":"https://github.com/d00rman","followers_url":"https://api.github.com/users/d00rman/followers","following_url":"https://api.github.com/users/d00rman/following{/other_user}","gists_url":"https://api.github.com/users/d00rman/gists{/gist_id}","starred_url":"https://api.github.com/users/d00rman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d00rman/subscriptions","organizations_url":"https://api.github.com/users/d00rman/orgs","repos_url":"https://api.github.com/users/d00rman/repos","events_url":"https://api.github.com/users/d00rman/events{/privacy}","received_events_url":"https://api.github.com/users/d00rman/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2016-02-09T00:35:38Z","updated_at":"2016-02-09T00:35:38Z","html_url":"https://github.com/wikimedia/restbase/pull/505#discussion_r52251910","pull_request_url":"https://api.github.com/repos/wikimedia/restbase/pulls/505","_links":{"self":{"href":"https://api.github.com/repos/wikimedia/restbase/pulls/comments/52251910"},"html":{"href":"https://github.com/wikimedia/restbase/pull/505#discussion_r52251910"},"pull_request":{"href":"https://api.github.com/repos/wikimedia/restbase/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/wikimedia/restbase/pulls/505","id":58687747,"html_url":"https://github.com/wikimedia/restbase/pull/505","diff_url":"https://github.com/wikimedia/restbase/pull/505.diff","patch_url":"https://github.com/wikimedia/restbase/pull/505.patch","issue_url":"https://api.github.com/repos/wikimedia/restbase/issues/505","number":505,"state":"open","locked":false,"title":"Chunked storage response streaming","user":{"login":"gwicke","id":1225898,"avatar_url":"https://avatars.githubusercontent.com/u/1225898?v=3","gravatar_id":"","url":"https://api.github.com/users/gwicke","html_url":"https://github.com/gwicke","followers_url":"https://api.github.com/users/gwicke/followers","following_url":"https://api.github.com/users/gwicke/following{/other_user}","gists_url":"https://api.github.com/users/gwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/gwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwicke/subscriptions","organizations_url":"https://api.github.com/users/gwicke/orgs","repos_url":"https://api.github.com/users/gwicke/repos","events_url":"https://api.github.com/users/gwicke/events{/privacy}","received_events_url":"https://api.github.com/users/gwicke/received_events","type":"User","site_admin":false},"body":"This patch changes the behavior of read requests to stream body chunks as they\r\nbecome available, rather than collecting & concatenating all chunks before\r\nreturning a response.\r\n\r\nThis patch also bumps up the default chunk size to 1.8mb, in line with the\r\nbenchmark results from https://phabricator.wikimedia.org/T122028. This won't\r\nprovide special compression efficiency with deflate, but will provide a decent\r\ncombination of compression ratio and scalability using brotli compression.","created_at":"2016-02-09T00:09:32Z","updated_at":"2016-02-09T00:35:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9ecb25f955e7ac39964b29dc2afea101b2852f0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wikimedia/restbase/pulls/505/commits","review_comments_url":"https://api.github.com/repos/wikimedia/restbase/pulls/505/comments","review_comment_url":"https://api.github.com/repos/wikimedia/restbase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wikimedia/restbase/issues/505/comments","statuses_url":"https://api.github.com/repos/wikimedia/restbase/statuses/2a1e4a4e6ef16c9f935df8c46a896cce11e20e81","head":{"label":"gwicke:streaming_chunk_responses","ref":"streaming_chunk_responses","sha":"2a1e4a4e6ef16c9f935df8c46a896cce11e20e81","user":{"login":"gwicke","id":1225898,"avatar_url":"https://avatars.githubusercontent.com/u/1225898?v=3","gravatar_id":"","url":"https://api.github.com/users/gwicke","html_url":"https://github.com/gwicke","followers_url":"https://api.github.com/users/gwicke/followers","following_url":"https://api.github.com/users/gwicke/following{/other_user}","gists_url":"https://api.github.com/users/gwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/gwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwicke/subscriptions","organizations_url":"https://api.github.com/users/gwicke/orgs","repos_url":"https://api.github.com/users/gwicke/repos","events_url":"https://api.github.com/users/gwicke/events{/privacy}","received_events_url":"https://api.github.com/users/gwicke/received_events","type":"User","site_admin":false},"repo":{"id":26503318,"name":"restbase","full_name":"gwicke/restbase","owner":{"login":"gwicke","id":1225898,"avatar_url":"https://avatars.githubusercontent.com/u/1225898?v=3","gravatar_id":"","url":"https://api.github.com/users/gwicke","html_url":"https://github.com/gwicke","followers_url":"https://api.github.com/users/gwicke/followers","following_url":"https://api.github.com/users/gwicke/following{/other_user}","gists_url":"https://api.github.com/users/gwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/gwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwicke/subscriptions","organizations_url":"https://api.github.com/users/gwicke/orgs","repos_url":"https://api.github.com/users/gwicke/repos","events_url":"https://api.github.com/users/gwicke/events{/privacy}","received_events_url":"https://api.github.com/users/gwicke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gwicke/restbase","description":"Distributed storage with REST API & dispatcher for backend services","fork":true,"url":"https://api.github.com/repos/gwicke/restbase","forks_url":"https://api.github.com/repos/gwicke/restbase/forks","keys_url":"https://api.github.com/repos/gwicke/restbase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gwicke/restbase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gwicke/restbase/teams","hooks_url":"https://api.github.com/repos/gwicke/restbase/hooks","issue_events_url":"https://api.github.com/repos/gwicke/restbase/issues/events{/number}","events_url":"https://api.github.com/repos/gwicke/restbase/events","assignees_url":"https://api.github.com/repos/gwicke/restbase/assignees{/user}","branches_url":"https://api.github.com/repos/gwicke/restbase/branches{/branch}","tags_url":"https://api.github.com/repos/gwicke/restbase/tags","blobs_url":"https://api.github.com/repos/gwicke/restbase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gwicke/restbase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gwicke/restbase/git/refs{/sha}","trees_url":"https://api.github.com/repos/gwicke/restbase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gwicke/restbase/statuses/{sha}","languages_url":"https://api.github.com/repos/gwicke/restbase/languages","stargazers_url":"https://api.github.com/repos/gwicke/restbase/stargazers","contributors_url":"https://api.github.com/repos/gwicke/restbase/contributors","subscribers_url":"https://api.github.com/repos/gwicke/restbase/subscribers","subscription_url":"https://api.github.com/repos/gwicke/restbase/subscription","commits_url":"https://api.github.com/repos/gwicke/restbase/commits{/sha}","git_commits_url":"https://api.github.com/repos/gwicke/restbase/git/commits{/sha}","comments_url":"https://api.github.com/repos/gwicke/restbase/comments{/number}","issue_comment_url":"https://api.github.com/repos/gwicke/restbase/issues/comments{/number}","contents_url":"https://api.github.com/repos/gwicke/restbase/contents/{+path}","compare_url":"https://api.github.com/repos/gwicke/restbase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gwicke/restbase/merges","archive_url":"https://api.github.com/repos/gwicke/restbase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gwicke/restbase/downloads","issues_url":"https://api.github.com/repos/gwicke/restbase/issues{/number}","pulls_url":"https://api.github.com/repos/gwicke/restbase/pulls{/number}","milestones_url":"https://api.github.com/repos/gwicke/restbase/milestones{/number}","notifications_url":"https://api.github.com/repos/gwicke/restbase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gwicke/restbase/labels{/name}","releases_url":"https://api.github.com/repos/gwicke/restbase/releases{/id}","deployments_url":"https://api.github.com/repos/gwicke/restbase/deployments","created_at":"2014-11-11T20:37:55Z","updated_at":"2016-02-01T06:40:28Z","pushed_at":"2016-02-09T00:26:50Z","git_url":"git://github.com/gwicke/restbase.git","ssh_url":"git@github.com:gwicke/restbase.git","clone_url":"https://github.com/gwicke/restbase.git","svn_url":"https://github.com/gwicke/restbase","homepage":"","size":2284,"stargazers_count":13,"watchers_count":13,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":13,"default_branch":"master"}},"base":{"label":"wikimedia:master","ref":"master","sha":"23134ef2e0d231cbf9ec8262adca89103a8cf921","user":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"repo":{"id":19002414,"name":"restbase","full_name":"wikimedia/restbase","owner":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wikimedia/restbase","description":"Distributed storage with REST API & dispatcher for backend services","fork":false,"url":"https://api.github.com/repos/wikimedia/restbase","forks_url":"https://api.github.com/repos/wikimedia/restbase/forks","keys_url":"https://api.github.com/repos/wikimedia/restbase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wikimedia/restbase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wikimedia/restbase/teams","hooks_url":"https://api.github.com/repos/wikimedia/restbase/hooks","issue_events_url":"https://api.github.com/repos/wikimedia/restbase/issues/events{/number}","events_url":"https://api.github.com/repos/wikimedia/restbase/events","assignees_url":"https://api.github.com/repos/wikimedia/restbase/assignees{/user}","branches_url":"https://api.github.com/repos/wikimedia/restbase/branches{/branch}","tags_url":"https://api.github.com/repos/wikimedia/restbase/tags","blobs_url":"https://api.github.com/repos/wikimedia/restbase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wikimedia/restbase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wikimedia/restbase/git/refs{/sha}","trees_url":"https://api.github.com/repos/wikimedia/restbase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wikimedia/restbase/statuses/{sha}","languages_url":"https://api.github.com/repos/wikimedia/restbase/languages","stargazers_url":"https://api.github.com/repos/wikimedia/restbase/stargazers","contributors_url":"https://api.github.com/repos/wikimedia/restbase/contributors","subscribers_url":"https://api.github.com/repos/wikimedia/restbase/subscribers","subscription_url":"https://api.github.com/repos/wikimedia/restbase/subscription","commits_url":"https://api.github.com/repos/wikimedia/restbase/commits{/sha}","git_commits_url":"https://api.github.com/repos/wikimedia/restbase/git/commits{/sha}","comments_url":"https://api.github.com/repos/wikimedia/restbase/comments{/number}","issue_comment_url":"https://api.github.com/repos/wikimedia/restbase/issues/comments{/number}","contents_url":"https://api.github.com/repos/wikimedia/restbase/contents/{+path}","compare_url":"https://api.github.com/repos/wikimedia/restbase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wikimedia/restbase/merges","archive_url":"https://api.github.com/repos/wikimedia/restbase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wikimedia/restbase/downloads","issues_url":"https://api.github.com/repos/wikimedia/restbase/issues{/number}","pulls_url":"https://api.github.com/repos/wikimedia/restbase/pulls{/number}","milestones_url":"https://api.github.com/repos/wikimedia/restbase/milestones{/number}","notifications_url":"https://api.github.com/repos/wikimedia/restbase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wikimedia/restbase/labels{/name}","releases_url":"https://api.github.com/repos/wikimedia/restbase/releases{/id}","deployments_url":"https://api.github.com/repos/wikimedia/restbase/deployments","created_at":"2014-04-21T18:35:00Z","updated_at":"2016-01-15T00:50:51Z","pushed_at":"2016-02-09T00:27:36Z","git_url":"git://github.com/wikimedia/restbase.git","ssh_url":"git@github.com:wikimedia/restbase.git","clone_url":"https://github.com/wikimedia/restbase.git","svn_url":"https://github.com/wikimedia/restbase","homepage":"https://www.mediawiki.org/wiki/RESTBase","size":2691,"stargazers_count":39,"watchers_count":39,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":28,"mirror_url":null,"open_issues_count":6,"forks":28,"open_issues":6,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wikimedia/restbase/pulls/505"},"html":{"href":"https://github.com/wikimedia/restbase/pull/505"},"issue":{"href":"https://api.github.com/repos/wikimedia/restbase/issues/505"},"comments":{"href":"https://api.github.com/repos/wikimedia/restbase/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/wikimedia/restbase/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/wikimedia/restbase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wikimedia/restbase/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/wikimedia/restbase/statuses/2a1e4a4e6ef16c9f935df8c46a896cce11e20e81"}}}}