{"action":"created","comment":{"url":"https://api.github.com/repos/airlift/airlift/pulls/comments/88549903","pull_request_review_id":9120960,"id":88549903,"diff_hunk":"@@ -1048,11 +1049,15 @@ public void close()\n     private static class BufferingResponseListener\n             extends Listener.Adapter\n     {\n+        private static final int LONGEST_ARRAY = 1 << 20;  // 1MB\n+        private static final int SHORTEST_ARRAY = 1 << 10; // 1KB\n         private final JettyResponseFuture<?, ?> future;\n         private final int maxLength;\n+        private final List<byte[]> arrays = new ArrayList<>();\n+\n+        private byte[] currentArray;\n+        private int nextBytes;","path":"http-client/src/main/java/io/airlift/http/client/jetty/JettyHttpClient.java","position":35,"original_position":35,"commit_id":"760ac3742029cec43e56435e2b0ebd846f422028","original_commit_id":"760ac3742029cec43e56435e2b0ebd846f422028","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"body":"rename `currentBufferPosition`","created_at":"2016-11-17T21:27:02Z","updated_at":"2016-11-17T21:28:25Z","html_url":"https://github.com/airlift/airlift/pull/480#discussion_r88549903","pull_request_url":"https://api.github.com/repos/airlift/airlift/pulls/480","_links":{"self":{"href":"https://api.github.com/repos/airlift/airlift/pulls/comments/88549903"},"html":{"href":"https://github.com/airlift/airlift/pull/480#discussion_r88549903"},"pull_request":{"href":"https://api.github.com/repos/airlift/airlift/pulls/480"}}},"pull_request":{"url":"https://api.github.com/repos/airlift/airlift/pulls/480","id":91832846,"html_url":"https://github.com/airlift/airlift/pull/480","diff_url":"https://github.com/airlift/airlift/pull/480.diff","patch_url":"https://github.com/airlift/airlift/pull/480.patch","issue_url":"https://api.github.com/repos/airlift/airlift/issues/480","number":480,"state":"open","locked":false,"title":"Buffer HTTP data with chunks","user":{"login":"geraint0923","id":923382,"avatar_url":"https://avatars.githubusercontent.com/u/923382?v=3","gravatar_id":"","url":"https://api.github.com/users/geraint0923","html_url":"https://github.com/geraint0923","followers_url":"https://api.github.com/users/geraint0923/followers","following_url":"https://api.github.com/users/geraint0923/following{/other_user}","gists_url":"https://api.github.com/users/geraint0923/gists{/gist_id}","starred_url":"https://api.github.com/users/geraint0923/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraint0923/subscriptions","organizations_url":"https://api.github.com/users/geraint0923/orgs","repos_url":"https://api.github.com/users/geraint0923/repos","events_url":"https://api.github.com/users/geraint0923/events{/privacy}","received_events_url":"https://api.github.com/users/geraint0923/received_events","type":"User","site_admin":false},"body":"- Avoid large byte array by buffering data with chunks\r\n- Use ScatteringByteArrayInputStream to wrap buffered data\r\n\r\nFixes https://github.com/prestodb/presto/issues/5350","created_at":"2016-11-01T18:02:29Z","updated_at":"2016-11-17T21:50:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65b66ba9c2879f8b9e72a950babc752c39ba5a87","assignee":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"assignees":[{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/airlift/airlift/pulls/480/commits","review_comments_url":"https://api.github.com/repos/airlift/airlift/pulls/480/comments","review_comment_url":"https://api.github.com/repos/airlift/airlift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airlift/airlift/issues/480/comments","statuses_url":"https://api.github.com/repos/airlift/airlift/statuses/760ac3742029cec43e56435e2b0ebd846f422028","head":{"label":"geraint0923:remove_max_length","ref":"remove_max_length","sha":"760ac3742029cec43e56435e2b0ebd846f422028","user":{"login":"geraint0923","id":923382,"avatar_url":"https://avatars.githubusercontent.com/u/923382?v=3","gravatar_id":"","url":"https://api.github.com/users/geraint0923","html_url":"https://github.com/geraint0923","followers_url":"https://api.github.com/users/geraint0923/followers","following_url":"https://api.github.com/users/geraint0923/following{/other_user}","gists_url":"https://api.github.com/users/geraint0923/gists{/gist_id}","starred_url":"https://api.github.com/users/geraint0923/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraint0923/subscriptions","organizations_url":"https://api.github.com/users/geraint0923/orgs","repos_url":"https://api.github.com/users/geraint0923/repos","events_url":"https://api.github.com/users/geraint0923/events{/privacy}","received_events_url":"https://api.github.com/users/geraint0923/received_events","type":"User","site_admin":false},"repo":{"id":54935044,"name":"airlift","full_name":"geraint0923/airlift","owner":{"login":"geraint0923","id":923382,"avatar_url":"https://avatars.githubusercontent.com/u/923382?v=3","gravatar_id":"","url":"https://api.github.com/users/geraint0923","html_url":"https://github.com/geraint0923","followers_url":"https://api.github.com/users/geraint0923/followers","following_url":"https://api.github.com/users/geraint0923/following{/other_user}","gists_url":"https://api.github.com/users/geraint0923/gists{/gist_id}","starred_url":"https://api.github.com/users/geraint0923/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraint0923/subscriptions","organizations_url":"https://api.github.com/users/geraint0923/orgs","repos_url":"https://api.github.com/users/geraint0923/repos","events_url":"https://api.github.com/users/geraint0923/events{/privacy}","received_events_url":"https://api.github.com/users/geraint0923/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geraint0923/airlift","description":"Airlift framework for building REST services","fork":true,"url":"https://api.github.com/repos/geraint0923/airlift","forks_url":"https://api.github.com/repos/geraint0923/airlift/forks","keys_url":"https://api.github.com/repos/geraint0923/airlift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geraint0923/airlift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geraint0923/airlift/teams","hooks_url":"https://api.github.com/repos/geraint0923/airlift/hooks","issue_events_url":"https://api.github.com/repos/geraint0923/airlift/issues/events{/number}","events_url":"https://api.github.com/repos/geraint0923/airlift/events","assignees_url":"https://api.github.com/repos/geraint0923/airlift/assignees{/user}","branches_url":"https://api.github.com/repos/geraint0923/airlift/branches{/branch}","tags_url":"https://api.github.com/repos/geraint0923/airlift/tags","blobs_url":"https://api.github.com/repos/geraint0923/airlift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geraint0923/airlift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geraint0923/airlift/git/refs{/sha}","trees_url":"https://api.github.com/repos/geraint0923/airlift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geraint0923/airlift/statuses/{sha}","languages_url":"https://api.github.com/repos/geraint0923/airlift/languages","stargazers_url":"https://api.github.com/repos/geraint0923/airlift/stargazers","contributors_url":"https://api.github.com/repos/geraint0923/airlift/contributors","subscribers_url":"https://api.github.com/repos/geraint0923/airlift/subscribers","subscription_url":"https://api.github.com/repos/geraint0923/airlift/subscription","commits_url":"https://api.github.com/repos/geraint0923/airlift/commits{/sha}","git_commits_url":"https://api.github.com/repos/geraint0923/airlift/git/commits{/sha}","comments_url":"https://api.github.com/repos/geraint0923/airlift/comments{/number}","issue_comment_url":"https://api.github.com/repos/geraint0923/airlift/issues/comments{/number}","contents_url":"https://api.github.com/repos/geraint0923/airlift/contents/{+path}","compare_url":"https://api.github.com/repos/geraint0923/airlift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geraint0923/airlift/merges","archive_url":"https://api.github.com/repos/geraint0923/airlift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geraint0923/airlift/downloads","issues_url":"https://api.github.com/repos/geraint0923/airlift/issues{/number}","pulls_url":"https://api.github.com/repos/geraint0923/airlift/pulls{/number}","milestones_url":"https://api.github.com/repos/geraint0923/airlift/milestones{/number}","notifications_url":"https://api.github.com/repos/geraint0923/airlift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geraint0923/airlift/labels{/name}","releases_url":"https://api.github.com/repos/geraint0923/airlift/releases{/id}","deployments_url":"https://api.github.com/repos/geraint0923/airlift/deployments","created_at":"2016-03-29T01:07:55Z","updated_at":"2016-03-29T01:07:58Z","pushed_at":"2016-11-17T21:02:13Z","git_url":"git://github.com/geraint0923/airlift.git","ssh_url":"git@github.com:geraint0923/airlift.git","clone_url":"https://github.com/geraint0923/airlift.git","svn_url":"https://github.com/geraint0923/airlift","homepage":"","size":18947,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"airlift:master","ref":"master","sha":"48209332063ed4da70389d28d1e026a50c1a9003","user":{"login":"airlift","id":1855389,"avatar_url":"https://avatars.githubusercontent.com/u/1855389?v=3","gravatar_id":"","url":"https://api.github.com/users/airlift","html_url":"https://github.com/airlift","followers_url":"https://api.github.com/users/airlift/followers","following_url":"https://api.github.com/users/airlift/following{/other_user}","gists_url":"https://api.github.com/users/airlift/gists{/gist_id}","starred_url":"https://api.github.com/users/airlift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airlift/subscriptions","organizations_url":"https://api.github.com/users/airlift/orgs","repos_url":"https://api.github.com/users/airlift/repos","events_url":"https://api.github.com/users/airlift/events{/privacy}","received_events_url":"https://api.github.com/users/airlift/received_events","type":"Organization","site_admin":false},"repo":{"id":4681328,"name":"airlift","full_name":"airlift/airlift","owner":{"login":"airlift","id":1855389,"avatar_url":"https://avatars.githubusercontent.com/u/1855389?v=3","gravatar_id":"","url":"https://api.github.com/users/airlift","html_url":"https://github.com/airlift","followers_url":"https://api.github.com/users/airlift/followers","following_url":"https://api.github.com/users/airlift/following{/other_user}","gists_url":"https://api.github.com/users/airlift/gists{/gist_id}","starred_url":"https://api.github.com/users/airlift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airlift/subscriptions","organizations_url":"https://api.github.com/users/airlift/orgs","repos_url":"https://api.github.com/users/airlift/repos","events_url":"https://api.github.com/users/airlift/events{/privacy}","received_events_url":"https://api.github.com/users/airlift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airlift/airlift","description":"Airlift framework for building REST services","fork":false,"url":"https://api.github.com/repos/airlift/airlift","forks_url":"https://api.github.com/repos/airlift/airlift/forks","keys_url":"https://api.github.com/repos/airlift/airlift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airlift/airlift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airlift/airlift/teams","hooks_url":"https://api.github.com/repos/airlift/airlift/hooks","issue_events_url":"https://api.github.com/repos/airlift/airlift/issues/events{/number}","events_url":"https://api.github.com/repos/airlift/airlift/events","assignees_url":"https://api.github.com/repos/airlift/airlift/assignees{/user}","branches_url":"https://api.github.com/repos/airlift/airlift/branches{/branch}","tags_url":"https://api.github.com/repos/airlift/airlift/tags","blobs_url":"https://api.github.com/repos/airlift/airlift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airlift/airlift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airlift/airlift/git/refs{/sha}","trees_url":"https://api.github.com/repos/airlift/airlift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airlift/airlift/statuses/{sha}","languages_url":"https://api.github.com/repos/airlift/airlift/languages","stargazers_url":"https://api.github.com/repos/airlift/airlift/stargazers","contributors_url":"https://api.github.com/repos/airlift/airlift/contributors","subscribers_url":"https://api.github.com/repos/airlift/airlift/subscribers","subscription_url":"https://api.github.com/repos/airlift/airlift/subscription","commits_url":"https://api.github.com/repos/airlift/airlift/commits{/sha}","git_commits_url":"https://api.github.com/repos/airlift/airlift/git/commits{/sha}","comments_url":"https://api.github.com/repos/airlift/airlift/comments{/number}","issue_comment_url":"https://api.github.com/repos/airlift/airlift/issues/comments{/number}","contents_url":"https://api.github.com/repos/airlift/airlift/contents/{+path}","compare_url":"https://api.github.com/repos/airlift/airlift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airlift/airlift/merges","archive_url":"https://api.github.com/repos/airlift/airlift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airlift/airlift/downloads","issues_url":"https://api.github.com/repos/airlift/airlift/issues{/number}","pulls_url":"https://api.github.com/repos/airlift/airlift/pulls{/number}","milestones_url":"https://api.github.com/repos/airlift/airlift/milestones{/number}","notifications_url":"https://api.github.com/repos/airlift/airlift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airlift/airlift/labels{/name}","releases_url":"https://api.github.com/repos/airlift/airlift/releases{/id}","deployments_url":"https://api.github.com/repos/airlift/airlift/deployments","created_at":"2012-06-16T00:33:13Z","updated_at":"2016-11-10T15:47:10Z","pushed_at":"2016-11-17T21:02:13Z","git_url":"git://github.com/airlift/airlift.git","ssh_url":"git@github.com:airlift/airlift.git","clone_url":"https://github.com/airlift/airlift.git","svn_url":"https://github.com/airlift/airlift","homepage":"","size":28796,"stargazers_count":175,"watchers_count":175,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":47,"forks":92,"open_issues":47,"watchers":175,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airlift/airlift/pulls/480"},"html":{"href":"https://github.com/airlift/airlift/pull/480"},"issue":{"href":"https://api.github.com/repos/airlift/airlift/issues/480"},"comments":{"href":"https://api.github.com/repos/airlift/airlift/issues/480/comments"},"review_comments":{"href":"https://api.github.com/repos/airlift/airlift/pulls/480/comments"},"review_comment":{"href":"https://api.github.com/repos/airlift/airlift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airlift/airlift/pulls/480/commits"},"statuses":{"href":"https://api.github.com/repos/airlift/airlift/statuses/760ac3742029cec43e56435e2b0ebd846f422028"}}}}
{"actor":{"display_login":"dain"}}