{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/167940744","pull_request_review_id":96230298,"id":167940744,"diff_hunk":"@@ -89,18 +89,70 @@ public String getName()\n       public InputStream openInputStream() throws IOException\n       {\n         try {\n-          synchronized (inputStreamOpener) {\n-            if (streamAcquired) {\n-              return storageObject.getDataInputStream();\n+          if (s3Object == null) {\n+            synchronized (inputStreamOpener) {\n+              if (s3Object == null) {\n+                // lazily promote to full GET\n+                s3Object = s3Client.getObject(objectSummary.getBucketName(), objectSummary.getKey());\n+              }\n             }\n-            // lazily promote to full GET\n-            storageObject = s3Client.getObject(s3Obj.getBucketName(), s3Obj.getKey());\n-            final InputStream stream = storageObject.getDataInputStream();\n-            streamAcquired = true;\n-            return stream;\n           }\n+\n+          return new InputStream()\n+          {\n+            final InputStream delegate = s3Object.getObjectContent();\n+\n+            @Override\n+            public int read() throws IOException\n+            {\n+              return delegate.read();\n+            }\n+\n+            @Override\n+            public int read(byte[] b, int off, int len) throws IOException\n+            {\n+              return delegate.read(b, off, len);\n+            }\n+\n+            @Override\n+            public long skip(long n) throws IOException\n+            {\n+              return delegate.skip(n);\n+            }\n+\n+            @Override\n+            public int available() throws IOException\n+            {\n+              return delegate.available();\n+            }\n+\n+            @Override\n+            public void reset() throws IOException\n+            {\n+              delegate.reset();\n+            }\n+\n+            @Override\n+            public void close() throws IOException\n+            {\n+              delegate.close();","path":"extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3DataSegmentPuller.java","position":102,"original_position":102,"commit_id":"19f502120d52b690bb43eb2ffa62fd8e04a8d830","original_commit_id":"19f502120d52b690bb43eb2ffa62fd8e04a8d830","user":{"login":"drcrallen","id":8213081,"avatar_url":"https://avatars2.githubusercontent.com/u/8213081?v=4","gravatar_id":"","url":"https://api.github.com/users/drcrallen","html_url":"https://github.com/drcrallen","followers_url":"https://api.github.com/users/drcrallen/followers","following_url":"https://api.github.com/users/drcrallen/following{/other_user}","gists_url":"https://api.github.com/users/drcrallen/gists{/gist_id}","starred_url":"https://api.github.com/users/drcrallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drcrallen/subscriptions","organizations_url":"https://api.github.com/users/drcrallen/orgs","repos_url":"https://api.github.com/users/drcrallen/repos","events_url":"https://api.github.com/users/drcrallen/events{/privacy}","received_events_url":"https://api.github.com/users/drcrallen/received_events","type":"User","site_admin":false},"body":"`s3Object` should still be closed even if delegate close has an error","created_at":"2018-02-13T17:30:17Z","updated_at":"2018-02-13T17:30:17Z","html_url":"https://github.com/druid-io/druid/pull/5382#discussion_r167940744","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/5382","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/167940744"},"html":{"href":"https://github.com/druid-io/druid/pull/5382#discussion_r167940744"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5382"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/5382","id":168669268,"html_url":"https://github.com/druid-io/druid/pull/5382","diff_url":"https://github.com/druid-io/druid/pull/5382.diff","patch_url":"https://github.com/druid-io/druid/pull/5382.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/5382","number":5382,"state":"open","locked":false,"title":"Use the official aws-sdk instead of jet3t","user":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars3.githubusercontent.com/u/2322288?v=4","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"body":"Fixes #4289.\r\n\r\nIn this PR, the version of the below libraries are changed.\r\n\r\n- Hadoop => 2.9.0 to match library versions\r\n- AWS-SDK => 1.11.29 (https://github.com/druid-io/druid/issues/4456)\r\n- Jackson => 2.8.10 \r\n- HttpClient => 4.5.3 (https://github.com/druid-io/druid/blob/master/common/pom.xml#L160-L169, https://issues.apache.org/jira/browse/HTTPCLIENT-1727)\r\n\r\nI've done the below tests.\r\n\r\n- Indexing\r\n\t- Hadoop indexing with Hadoop 2.9.0\r\n\t- Hadoop indexing with Hadoop 3.0\r\n\t- Local indexing\r\n\t\t- With prefetch\r\n\t\t- Without prefetch\r\n- `insert-segment-to-db` tool: this tool finds segments under the given directory of deep storage\r\n- Moving segments with moveTask\r\n- Killing segments with killTask\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/druid-io/druid/5382)\n<!-- Reviewable:end -->\n","created_at":"2018-02-12T19:38:30Z","updated_at":"2018-02-13T17:30:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b70590687f391c8308bcb50b8f98bb532e64242","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":533766549,"url":"https://api.github.com/repos/druid-io/druid/labels/WIP","name":"WIP","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/5382/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/5382/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/5382/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/19f502120d52b690bb43eb2ffa62fd8e04a8d830","head":{"label":"jihoonson:aws-sdk","ref":"aws-sdk","sha":"19f502120d52b690bb43eb2ffa62fd8e04a8d830","user":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars3.githubusercontent.com/u/2322288?v=4","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"repo":{"id":71565181,"name":"druid","full_name":"jihoonson/druid","owner":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars3.githubusercontent.com/u/2322288?v=4","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jihoonson/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":true,"url":"https://api.github.com/repos/jihoonson/druid","forks_url":"https://api.github.com/repos/jihoonson/druid/forks","keys_url":"https://api.github.com/repos/jihoonson/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jihoonson/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jihoonson/druid/teams","hooks_url":"https://api.github.com/repos/jihoonson/druid/hooks","issue_events_url":"https://api.github.com/repos/jihoonson/druid/issues/events{/number}","events_url":"https://api.github.com/repos/jihoonson/druid/events","assignees_url":"https://api.github.com/repos/jihoonson/druid/assignees{/user}","branches_url":"https://api.github.com/repos/jihoonson/druid/branches{/branch}","tags_url":"https://api.github.com/repos/jihoonson/druid/tags","blobs_url":"https://api.github.com/repos/jihoonson/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jihoonson/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jihoonson/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/jihoonson/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jihoonson/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/jihoonson/druid/languages","stargazers_url":"https://api.github.com/repos/jihoonson/druid/stargazers","contributors_url":"https://api.github.com/repos/jihoonson/druid/contributors","subscribers_url":"https://api.github.com/repos/jihoonson/druid/subscribers","subscription_url":"https://api.github.com/repos/jihoonson/druid/subscription","commits_url":"https://api.github.com/repos/jihoonson/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/jihoonson/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/jihoonson/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/jihoonson/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/jihoonson/druid/contents/{+path}","compare_url":"https://api.github.com/repos/jihoonson/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jihoonson/druid/merges","archive_url":"https://api.github.com/repos/jihoonson/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jihoonson/druid/downloads","issues_url":"https://api.github.com/repos/jihoonson/druid/issues{/number}","pulls_url":"https://api.github.com/repos/jihoonson/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/jihoonson/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/jihoonson/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jihoonson/druid/labels{/name}","releases_url":"https://api.github.com/repos/jihoonson/druid/releases{/id}","deployments_url":"https://api.github.com/repos/jihoonson/druid/deployments","created_at":"2016-10-21T13:05:19Z","updated_at":"2016-10-21T13:05:32Z","pushed_at":"2018-02-13T06:32:34Z","git_url":"git://github.com/jihoonson/druid.git","ssh_url":"git@github.com:jihoonson/druid.git","clone_url":"https://github.com/jihoonson/druid.git","svn_url":"https://github.com/jihoonson/druid","homepage":"http://druid.io","size":134706,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"druid-io:master","ref":"master","sha":"06f0067b6cbd08a4fa9c3db42ea550222b1568bd","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars0.githubusercontent.com/u/4203474?v=4","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars0.githubusercontent.com/u/4203474?v=4","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","deployments_url":"https://api.github.com/repos/druid-io/druid/deployments","created_at":"2012-10-23T19:08:07Z","updated_at":"2018-02-13T03:02:10Z","pushed_at":"2018-02-13T17:20:07Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":134033,"stargazers_count":6093,"watchers_count":6093,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1502,"mirror_url":null,"archived":false,"open_issues_count":913,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1502,"open_issues":913,"watchers":6093,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5382"},"html":{"href":"https://github.com/druid-io/druid/pull/5382"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/5382"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/5382/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5382/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5382/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/19f502120d52b690bb43eb2ffa62fd8e04a8d830"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"drcrallen"}}