{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/ambry/pulls/comments/193214398","pull_request_review_id":126143458,"id":193214398,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzIxNDM5OA==","diff_hunk":"@@ -721,6 +721,27 @@ public static long addSecondsToEpochTime(long epochTimeInMs, long deltaTimeInSec\n     return data;\n   }\n \n+  /**\n+   * Read {@link FileChannel} from a given offset to fill up a {@link ByteBuffer}. Total bytes read should be buffer's\n+   * remaining size(limit - position).\n+   * @param fileChannel from which data to be read from\n+   * @param offset starting offset of the fileChanel to be read from\n+   * @param buffer the destination of the read\n+   * @throws IOException\n+   */\n+  public static void readFileToByteBuffer(FileChannel fileChannel, long offset, ByteBuffer buffer) throws IOException {\n+    int read = 0;\n+    int expectedRead = buffer.remaining();\n+    while (buffer.hasRemaining()) {\n+      int sizeRead = fileChannel.read(buffer, offset);\n+      if (sizeRead == 0 || sizeRead == -1) {","path":"ambry-utils/src/main/java/com.github.ambry.utils/Utils.java","position":17,"original_position":17,"commit_id":"9bcceac0151ad8b53ac7db3a925e193e7f7e2540","original_commit_id":"9bcceac0151ad8b53ac7db3a925e193e7f7e2540","user":{"login":"pnarayanan","id":1454915,"node_id":"MDQ6VXNlcjE0NTQ5MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1454915?v=4","gravatar_id":"","url":"https://api.github.com/users/pnarayanan","html_url":"https://github.com/pnarayanan","followers_url":"https://api.github.com/users/pnarayanan/followers","following_url":"https://api.github.com/users/pnarayanan/following{/other_user}","gists_url":"https://api.github.com/users/pnarayanan/gists{/gist_id}","starred_url":"https://api.github.com/users/pnarayanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnarayanan/subscriptions","organizations_url":"https://api.github.com/users/pnarayanan/orgs","repos_url":"https://api.github.com/users/pnarayanan/repos","events_url":"https://api.github.com/users/pnarayanan/events{/privacy}","received_events_url":"https://api.github.com/users/pnarayanan/received_events","type":"User","site_admin":false},"body":"Is `size == 0` is an exception scenario? (as in, is `FileChannel` necessarily blocking)? ","created_at":"2018-06-05T20:39:31Z","updated_at":"2018-06-05T20:51:19Z","html_url":"https://github.com/linkedin/ambry/pull/930#discussion_r193214398","pull_request_url":"https://api.github.com/repos/linkedin/ambry/pulls/930","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/linkedin/ambry/pulls/comments/193214398"},"html":{"href":"https://github.com/linkedin/ambry/pull/930#discussion_r193214398"},"pull_request":{"href":"https://api.github.com/repos/linkedin/ambry/pulls/930"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/ambry/pulls/930","id":189483119,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5NDgzMTE5","html_url":"https://github.com/linkedin/ambry/pull/930","diff_url":"https://github.com/linkedin/ambry/pull/930.diff","patch_url":"https://github.com/linkedin/ambry/pull/930.patch","issue_url":"https://api.github.com/repos/linkedin/ambry/issues/930","number":930,"state":"open","locked":false,"title":"Do bundled read in compaction copy phase.","user":{"login":"zzmao","id":34247652,"node_id":"MDQ6VXNlcjM0MjQ3NjUy","avatar_url":"https://avatars3.githubusercontent.com/u/34247652?v=4","gravatar_id":"","url":"https://api.github.com/users/zzmao","html_url":"https://github.com/zzmao","followers_url":"https://api.github.com/users/zzmao/followers","following_url":"https://api.github.com/users/zzmao/following{/other_user}","gists_url":"https://api.github.com/users/zzmao/gists{/gist_id}","starred_url":"https://api.github.com/users/zzmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzmao/subscriptions","organizations_url":"https://api.github.com/users/zzmao/orgs","repos_url":"https://api.github.com/users/zzmao/repos","events_url":"https://api.github.com/users/zzmao/events{/privacy}","received_events_url":"https://api.github.com/users/zzmao/received_events","type":"User","site_admin":false},"body":"To avoid multiple small IO read and improve disk utilization.","created_at":"2018-05-21T20:43:45Z","updated_at":"2018-06-05T20:51:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b81cd78e94b1b024ea8a8a53a0400e0871012f0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/ambry/pulls/930/commits","review_comments_url":"https://api.github.com/repos/linkedin/ambry/pulls/930/comments","review_comment_url":"https://api.github.com/repos/linkedin/ambry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/ambry/issues/930/comments","statuses_url":"https://api.github.com/repos/linkedin/ambry/statuses/9bcceac0151ad8b53ac7db3a925e193e7f7e2540","head":{"label":"zzmao:bundle","ref":"bundle","sha":"9bcceac0151ad8b53ac7db3a925e193e7f7e2540","user":{"login":"zzmao","id":34247652,"node_id":"MDQ6VXNlcjM0MjQ3NjUy","avatar_url":"https://avatars3.githubusercontent.com/u/34247652?v=4","gravatar_id":"","url":"https://api.github.com/users/zzmao","html_url":"https://github.com/zzmao","followers_url":"https://api.github.com/users/zzmao/followers","following_url":"https://api.github.com/users/zzmao/following{/other_user}","gists_url":"https://api.github.com/users/zzmao/gists{/gist_id}","starred_url":"https://api.github.com/users/zzmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzmao/subscriptions","organizations_url":"https://api.github.com/users/zzmao/orgs","repos_url":"https://api.github.com/users/zzmao/repos","events_url":"https://api.github.com/users/zzmao/events{/privacy}","received_events_url":"https://api.github.com/users/zzmao/received_events","type":"User","site_admin":false},"repo":{"id":113078328,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMwNzgzMjg=","name":"ambry","full_name":"zzmao/ambry","owner":{"login":"zzmao","id":34247652,"node_id":"MDQ6VXNlcjM0MjQ3NjUy","avatar_url":"https://avatars3.githubusercontent.com/u/34247652?v=4","gravatar_id":"","url":"https://api.github.com/users/zzmao","html_url":"https://github.com/zzmao","followers_url":"https://api.github.com/users/zzmao/followers","following_url":"https://api.github.com/users/zzmao/following{/other_user}","gists_url":"https://api.github.com/users/zzmao/gists{/gist_id}","starred_url":"https://api.github.com/users/zzmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzmao/subscriptions","organizations_url":"https://api.github.com/users/zzmao/orgs","repos_url":"https://api.github.com/users/zzmao/repos","events_url":"https://api.github.com/users/zzmao/events{/privacy}","received_events_url":"https://api.github.com/users/zzmao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zzmao/ambry","description":"Distributed object store","fork":true,"url":"https://api.github.com/repos/zzmao/ambry","forks_url":"https://api.github.com/repos/zzmao/ambry/forks","keys_url":"https://api.github.com/repos/zzmao/ambry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zzmao/ambry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zzmao/ambry/teams","hooks_url":"https://api.github.com/repos/zzmao/ambry/hooks","issue_events_url":"https://api.github.com/repos/zzmao/ambry/issues/events{/number}","events_url":"https://api.github.com/repos/zzmao/ambry/events","assignees_url":"https://api.github.com/repos/zzmao/ambry/assignees{/user}","branches_url":"https://api.github.com/repos/zzmao/ambry/branches{/branch}","tags_url":"https://api.github.com/repos/zzmao/ambry/tags","blobs_url":"https://api.github.com/repos/zzmao/ambry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zzmao/ambry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zzmao/ambry/git/refs{/sha}","trees_url":"https://api.github.com/repos/zzmao/ambry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zzmao/ambry/statuses/{sha}","languages_url":"https://api.github.com/repos/zzmao/ambry/languages","stargazers_url":"https://api.github.com/repos/zzmao/ambry/stargazers","contributors_url":"https://api.github.com/repos/zzmao/ambry/contributors","subscribers_url":"https://api.github.com/repos/zzmao/ambry/subscribers","subscription_url":"https://api.github.com/repos/zzmao/ambry/subscription","commits_url":"https://api.github.com/repos/zzmao/ambry/commits{/sha}","git_commits_url":"https://api.github.com/repos/zzmao/ambry/git/commits{/sha}","comments_url":"https://api.github.com/repos/zzmao/ambry/comments{/number}","issue_comment_url":"https://api.github.com/repos/zzmao/ambry/issues/comments{/number}","contents_url":"https://api.github.com/repos/zzmao/ambry/contents/{+path}","compare_url":"https://api.github.com/repos/zzmao/ambry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zzmao/ambry/merges","archive_url":"https://api.github.com/repos/zzmao/ambry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zzmao/ambry/downloads","issues_url":"https://api.github.com/repos/zzmao/ambry/issues{/number}","pulls_url":"https://api.github.com/repos/zzmao/ambry/pulls{/number}","milestones_url":"https://api.github.com/repos/zzmao/ambry/milestones{/number}","notifications_url":"https://api.github.com/repos/zzmao/ambry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zzmao/ambry/labels{/name}","releases_url":"https://api.github.com/repos/zzmao/ambry/releases{/id}","deployments_url":"https://api.github.com/repos/zzmao/ambry/deployments","created_at":"2017-12-04T18:18:42Z","updated_at":"2018-06-04T22:06:12Z","pushed_at":"2018-06-05T01:49:47Z","git_url":"git://github.com/zzmao/ambry.git","ssh_url":"git@github.com:zzmao/ambry.git","clone_url":"https://github.com/zzmao/ambry.git","svn_url":"https://github.com/zzmao/ambry","homepage":"https://github.com/linkedin/ambry/wiki","size":12931,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"87cd95ef324ecc3b4a3c7e647c98b4b3f8868319","user":{"login":"linkedin","id":357098,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NzA5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/357098?v=4","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":13870893,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg3MDg5Mw==","name":"ambry","full_name":"linkedin/ambry","owner":{"login":"linkedin","id":357098,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NzA5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/357098?v=4","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/ambry","description":"Distributed object store","fork":false,"url":"https://api.github.com/repos/linkedin/ambry","forks_url":"https://api.github.com/repos/linkedin/ambry/forks","keys_url":"https://api.github.com/repos/linkedin/ambry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/ambry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/ambry/teams","hooks_url":"https://api.github.com/repos/linkedin/ambry/hooks","issue_events_url":"https://api.github.com/repos/linkedin/ambry/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/ambry/events","assignees_url":"https://api.github.com/repos/linkedin/ambry/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/ambry/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/ambry/tags","blobs_url":"https://api.github.com/repos/linkedin/ambry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/ambry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/ambry/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/ambry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/ambry/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/ambry/languages","stargazers_url":"https://api.github.com/repos/linkedin/ambry/stargazers","contributors_url":"https://api.github.com/repos/linkedin/ambry/contributors","subscribers_url":"https://api.github.com/repos/linkedin/ambry/subscribers","subscription_url":"https://api.github.com/repos/linkedin/ambry/subscription","commits_url":"https://api.github.com/repos/linkedin/ambry/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/ambry/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/ambry/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/ambry/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/ambry/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/ambry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/ambry/merges","archive_url":"https://api.github.com/repos/linkedin/ambry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/ambry/downloads","issues_url":"https://api.github.com/repos/linkedin/ambry/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/ambry/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/ambry/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/ambry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/ambry/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/ambry/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/ambry/deployments","created_at":"2013-10-25T20:04:54Z","updated_at":"2018-06-05T03:18:44Z","pushed_at":"2018-06-05T20:09:40Z","git_url":"git://github.com/linkedin/ambry.git","ssh_url":"git@github.com:linkedin/ambry.git","clone_url":"https://github.com/linkedin/ambry.git","svn_url":"https://github.com/linkedin/ambry","homepage":"https://github.com/linkedin/ambry/wiki","size":12592,"stargazers_count":1061,"watchers_count":1061,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"archived":false,"open_issues_count":98,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":204,"open_issues":98,"watchers":1061,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/ambry/pulls/930"},"html":{"href":"https://github.com/linkedin/ambry/pull/930"},"issue":{"href":"https://api.github.com/repos/linkedin/ambry/issues/930"},"comments":{"href":"https://api.github.com/repos/linkedin/ambry/issues/930/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/ambry/pulls/930/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/ambry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/ambry/pulls/930/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/ambry/statuses/9bcceac0151ad8b53ac7db3a925e193e7f7e2540"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pnarayanan"}}