{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/presto/pulls/comments/39100904","id":39100904,"diff_hunk":"@@ -0,0 +1,62 @@\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package com.facebook.presto.raptor;\n+\n+import com.facebook.presto.raptor.storage.StorageManagerConfig;\n+import com.facebook.presto.spi.ConnectorSession;\n+import com.google.inject.Inject;\n+import io.airlift.units.DataSize;\n+\n+import static java.util.Objects.requireNonNull;\n+\n+public class ReaderAttributes\n+{\n+    private final DataSize maxMergeDistance;\n+    private final DataSize maxReadSize;\n+    private final DataSize streamBufferSize;\n+\n+    @Inject\n+    public ReaderAttributes(StorageManagerConfig config)\n+    {\n+        this(config.getOrcMaxMergeDistance(), config.getOrcMaxReadSize(), config.getOrcStreamBufferSize());\n+    }\n+\n+    public ReaderAttributes(DataSize maxMergeDistance, DataSize maxReadSize, DataSize streamBufferSize)\n+    {\n+        this.maxMergeDistance = requireNonNull(maxMergeDistance, \"maxMergeDistance is null\");\n+        this.maxReadSize = requireNonNull(maxReadSize, \"maxReadSize is null\");\n+        this.streamBufferSize = requireNonNull(streamBufferSize, \"streamBufferSize is null\");\n+    }\n+\n+    public DataSize getMaxMergeDistance()\n+    {\n+        return maxMergeDistance;\n+    }\n+\n+    public DataSize getMaxReadSize()\n+    {\n+        return maxReadSize;\n+    }\n+\n+    public DataSize getStreamBufferSize()\n+    {\n+        return streamBufferSize;\n+    }\n+\n+    public static ReaderAttributes extractReaderAttributes(ConnectorSession session)","path":"presto-raptor/src/main/java/com/facebook/presto/raptor/ReaderAttributes.java","position":57,"original_position":57,"commit_id":"9bfa2a5a77b5800cb44d76adc437461401d18897","original_commit_id":"9bfa2a5a77b5800cb44d76adc437461401d18897","user":{"login":"electrum","id":9230,"avatar_url":"https://avatars.githubusercontent.com/u/9230?v=3","gravatar_id":"","url":"https://api.github.com/users/electrum","html_url":"https://github.com/electrum","followers_url":"https://api.github.com/users/electrum/followers","following_url":"https://api.github.com/users/electrum/following{/other_user}","gists_url":"https://api.github.com/users/electrum/gists{/gist_id}","starred_url":"https://api.github.com/users/electrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electrum/subscriptions","organizations_url":"https://api.github.com/users/electrum/orgs","repos_url":"https://api.github.com/users/electrum/repos","events_url":"https://api.github.com/users/electrum/events{/privacy}","received_events_url":"https://api.github.com/users/electrum/received_events","type":"User","site_admin":false},"body":"How about `from` so you do `ReaderAttributes.from(...)`","created_at":"2015-09-09T21:46:34Z","updated_at":"2015-09-09T21:46:34Z","html_url":"https://github.com/facebook/presto/pull/3574#discussion_r39100904","pull_request_url":"https://api.github.com/repos/facebook/presto/pulls/3574","_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments/39100904"},"html":{"href":"https://github.com/facebook/presto/pull/3574#discussion_r39100904"},"pull_request":{"href":"https://api.github.com/repos/facebook/presto/pulls/3574"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/3574","id":44594726,"html_url":"https://github.com/facebook/presto/pull/3574","diff_url":"https://github.com/facebook/presto/pull/3574.diff","patch_url":"https://github.com/facebook/presto/pull/3574.patch","issue_url":"https://api.github.com/repos/facebook/presto/issues/3574","number":3574,"state":"open","locked":false,"title":"Add session properties for reader in Raptor","user":{"login":"nileema","id":1034143,"avatar_url":"https://avatars.githubusercontent.com/u/1034143?v=3","gravatar_id":"","url":"https://api.github.com/users/nileema","html_url":"https://github.com/nileema","followers_url":"https://api.github.com/users/nileema/followers","following_url":"https://api.github.com/users/nileema/following{/other_user}","gists_url":"https://api.github.com/users/nileema/gists{/gist_id}","starred_url":"https://api.github.com/users/nileema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nileema/subscriptions","organizations_url":"https://api.github.com/users/nileema/orgs","repos_url":"https://api.github.com/users/nileema/repos","events_url":"https://api.github.com/users/nileema/events{/privacy}","received_events_url":"https://api.github.com/users/nileema/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-09T20:14:00Z","updated_at":"2015-09-09T21:46:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38cb799270c8a3484ce9efd4646563853bfe6099","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},"milestone":null,"commits_url":"https://api.github.com/repos/facebook/presto/pulls/3574/commits","review_comments_url":"https://api.github.com/repos/facebook/presto/pulls/3574/comments","review_comment_url":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/presto/issues/3574/comments","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/9bfa2a5a77b5800cb44d76adc437461401d18897","head":{"label":"nileema:raptor-orc-reader","ref":"raptor-orc-reader","sha":"9bfa2a5a77b5800cb44d76adc437461401d18897","user":{"login":"nileema","id":1034143,"avatar_url":"https://avatars.githubusercontent.com/u/1034143?v=3","gravatar_id":"","url":"https://api.github.com/users/nileema","html_url":"https://github.com/nileema","followers_url":"https://api.github.com/users/nileema/followers","following_url":"https://api.github.com/users/nileema/following{/other_user}","gists_url":"https://api.github.com/users/nileema/gists{/gist_id}","starred_url":"https://api.github.com/users/nileema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nileema/subscriptions","organizations_url":"https://api.github.com/users/nileema/orgs","repos_url":"https://api.github.com/users/nileema/repos","events_url":"https://api.github.com/users/nileema/events{/privacy}","received_events_url":"https://api.github.com/users/nileema/received_events","type":"User","site_admin":false},"repo":{"id":12574341,"name":"presto","full_name":"nileema/presto","owner":{"login":"nileema","id":1034143,"avatar_url":"https://avatars.githubusercontent.com/u/1034143?v=3","gravatar_id":"","url":"https://api.github.com/users/nileema","html_url":"https://github.com/nileema","followers_url":"https://api.github.com/users/nileema/followers","following_url":"https://api.github.com/users/nileema/following{/other_user}","gists_url":"https://api.github.com/users/nileema/gists{/gist_id}","starred_url":"https://api.github.com/users/nileema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nileema/subscriptions","organizations_url":"https://api.github.com/users/nileema/orgs","repos_url":"https://api.github.com/users/nileema/repos","events_url":"https://api.github.com/users/nileema/events{/privacy}","received_events_url":"https://api.github.com/users/nileema/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nileema/presto","description":"","fork":true,"url":"https://api.github.com/repos/nileema/presto","forks_url":"https://api.github.com/repos/nileema/presto/forks","keys_url":"https://api.github.com/repos/nileema/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nileema/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nileema/presto/teams","hooks_url":"https://api.github.com/repos/nileema/presto/hooks","issue_events_url":"https://api.github.com/repos/nileema/presto/issues/events{/number}","events_url":"https://api.github.com/repos/nileema/presto/events","assignees_url":"https://api.github.com/repos/nileema/presto/assignees{/user}","branches_url":"https://api.github.com/repos/nileema/presto/branches{/branch}","tags_url":"https://api.github.com/repos/nileema/presto/tags","blobs_url":"https://api.github.com/repos/nileema/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nileema/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nileema/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/nileema/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nileema/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/nileema/presto/languages","stargazers_url":"https://api.github.com/repos/nileema/presto/stargazers","contributors_url":"https://api.github.com/repos/nileema/presto/contributors","subscribers_url":"https://api.github.com/repos/nileema/presto/subscribers","subscription_url":"https://api.github.com/repos/nileema/presto/subscription","commits_url":"https://api.github.com/repos/nileema/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/nileema/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/nileema/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/nileema/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/nileema/presto/contents/{+path}","compare_url":"https://api.github.com/repos/nileema/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nileema/presto/merges","archive_url":"https://api.github.com/repos/nileema/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nileema/presto/downloads","issues_url":"https://api.github.com/repos/nileema/presto/issues{/number}","pulls_url":"https://api.github.com/repos/nileema/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/nileema/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/nileema/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nileema/presto/labels{/name}","releases_url":"https://api.github.com/repos/nileema/presto/releases{/id}","created_at":"2013-09-03T20:40:19Z","updated_at":"2014-08-13T18:36:54Z","pushed_at":"2015-09-09T20:31:43Z","git_url":"git://github.com/nileema/presto.git","ssh_url":"git@github.com:nileema/presto.git","clone_url":"https://github.com/nileema/presto.git","svn_url":"https://github.com/nileema/presto","homepage":null,"size":43102,"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":"facebook:master","ref":"master","sha":"a2b81883b01b0bac0c0a3c55b9adff6a0ec4832e","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"facebook/presto","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":false,"url":"https://api.github.com/repos/facebook/presto","forks_url":"https://api.github.com/repos/facebook/presto/forks","keys_url":"https://api.github.com/repos/facebook/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/presto/teams","hooks_url":"https://api.github.com/repos/facebook/presto/hooks","issue_events_url":"https://api.github.com/repos/facebook/presto/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/presto/events","assignees_url":"https://api.github.com/repos/facebook/presto/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/presto/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/presto/tags","blobs_url":"https://api.github.com/repos/facebook/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/presto/languages","stargazers_url":"https://api.github.com/repos/facebook/presto/stargazers","contributors_url":"https://api.github.com/repos/facebook/presto/contributors","subscribers_url":"https://api.github.com/repos/facebook/presto/subscribers","subscription_url":"https://api.github.com/repos/facebook/presto/subscription","commits_url":"https://api.github.com/repos/facebook/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/presto/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/presto/merges","archive_url":"https://api.github.com/repos/facebook/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/presto/downloads","issues_url":"https://api.github.com/repos/facebook/presto/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/presto/labels{/name}","releases_url":"https://api.github.com/repos/facebook/presto/releases{/id}","created_at":"2012-08-09T01:03:37Z","updated_at":"2015-09-09T15:34:37Z","pushed_at":"2015-09-09T21:37:37Z","git_url":"git://github.com/facebook/presto.git","ssh_url":"git@github.com:facebook/presto.git","clone_url":"https://github.com/facebook/presto.git","svn_url":"https://github.com/facebook/presto","homepage":"https://prestodb.io","size":100202,"stargazers_count":3810,"watchers_count":3810,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":969,"mirror_url":null,"open_issues_count":331,"forks":969,"open_issues":331,"watchers":3810,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/3574"},"html":{"href":"https://github.com/facebook/presto/pull/3574"},"issue":{"href":"https://api.github.com/repos/facebook/presto/issues/3574"},"comments":{"href":"https://api.github.com/repos/facebook/presto/issues/3574/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/presto/pulls/3574/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/presto/pulls/3574/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/presto/statuses/9bfa2a5a77b5800cb44d76adc437461401d18897"}}}}