{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/presto/pulls/comments/44196763","id":44196763,"diff_hunk":"@@ -0,0 +1,187 @@\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.hive;\n+\n+import com.facebook.presto.GroupByHashPageIndexerFactory;\n+import com.facebook.presto.hive.metastore.CachingHiveMetastore;\n+import com.facebook.presto.hive.metastore.HiveMetastore;\n+import com.facebook.presto.spi.ConnectorMetadata;\n+import com.facebook.presto.spi.ConnectorPageSinkProvider;\n+import com.facebook.presto.spi.ConnectorPageSourceProvider;\n+import com.facebook.presto.spi.ConnectorSplitManager;\n+import com.google.common.net.HostAndPort;\n+import io.airlift.json.JsonCodec;\n+import io.airlift.units.Duration;\n+import org.joda.time.DateTimeZone;\n+\n+import java.util.TimeZone;\n+import java.util.concurrent.ExecutorService;\n+\n+import static com.facebook.presto.hive.HiveTestUtils.DEFAULT_HIVE_DATA_STREAM_FACTORIES;\n+import static com.facebook.presto.hive.HiveTestUtils.DEFAULT_HIVE_RECORD_CURSOR_PROVIDER;\n+import static com.facebook.presto.hive.HiveTestUtils.TYPE_MANAGER;\n+import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;\n+import static io.airlift.concurrent.Threads.daemonThreadsNamed;\n+import static java.util.concurrent.Executors.newCachedThreadPool;\n+\n+public class HiveTestingEnvironment\n+    implements TestingEnvironment\n+{\n+    private HdfsEnvironment hdfsEnvironment;\n+    private LocationService locationService;\n+\n+    private ConnectorMetadata metadata;\n+    private ConnectorSplitManager splitManager;\n+    private ConnectorPageSourceProvider pageSourceProvider;\n+    private ConnectorPageSinkProvider pageSinkProvider;\n+    private HiveMetastore metastoreClient;\n+\n+    private ExecutorService executor;\n+    private DateTimeZone timeZone;\n+\n+    public HiveTestingEnvironment(","path":"presto-hive/src/test/java/com/facebook/presto/hive/HiveTestingEnvironment.java","position":53,"original_position":53,"commit_id":"0a6ac23712092f69d1f37aeca11a9c17ce2334a2","original_commit_id":"0a6ac23712092f69d1f37aeca11a9c17ce2334a2","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":"Should this be `private` or package protected?","created_at":"2015-11-06T22:51:39Z","updated_at":"2015-11-06T22:51:39Z","html_url":"https://github.com/facebook/presto/pull/3911#discussion_r44196763","pull_request_url":"https://api.github.com/repos/facebook/presto/pulls/3911","_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments/44196763"},"html":{"href":"https://github.com/facebook/presto/pull/3911#discussion_r44196763"},"pull_request":{"href":"https://api.github.com/repos/facebook/presto/pulls/3911"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/3911","id":50012027,"html_url":"https://github.com/facebook/presto/pull/3911","diff_url":"https://github.com/facebook/presto/pull/3911.diff","patch_url":"https://github.com/facebook/presto/pull/3911.patch","issue_url":"https://api.github.com/repos/facebook/presto/issues/3911","number":3911,"state":"open","locked":false,"title":"Decouple state from tests in AbstractTestHiveClient","user":{"login":"martint","id":14387,"avatar_url":"https://avatars.githubusercontent.com/u/14387?v=3","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"body":"Decouple the testing fixture and runtime from the tests so that they\r\ncan be plugged in by concrete plugin implementations as needed.\r\n\r\nThis solves an issue where setup methods in children would be invoked\r\nnon-deterministically by TestNG, and also helps clean up and untangle\r\nthat code.","created_at":"2015-11-06T22:21:04Z","updated_at":"2015-11-06T22:51:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ba7f93a24e6d8be5463751e10920d85edd04a11","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/presto/pulls/3911/commits","review_comments_url":"https://api.github.com/repos/facebook/presto/pulls/3911/comments","review_comment_url":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/presto/issues/3911/comments","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/0a6ac23712092f69d1f37aeca11a9c17ce2334a2","head":{"label":"martint:tests","ref":"tests","sha":"0a6ac23712092f69d1f37aeca11a9c17ce2334a2","user":{"login":"martint","id":14387,"avatar_url":"https://avatars.githubusercontent.com/u/14387?v=3","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"repo":{"id":5498382,"name":"presto","full_name":"martint/presto","owner":{"login":"martint","id":14387,"avatar_url":"https://avatars.githubusercontent.com/u/14387?v=3","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martint/presto","description":"","fork":true,"url":"https://api.github.com/repos/martint/presto","forks_url":"https://api.github.com/repos/martint/presto/forks","keys_url":"https://api.github.com/repos/martint/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martint/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martint/presto/teams","hooks_url":"https://api.github.com/repos/martint/presto/hooks","issue_events_url":"https://api.github.com/repos/martint/presto/issues/events{/number}","events_url":"https://api.github.com/repos/martint/presto/events","assignees_url":"https://api.github.com/repos/martint/presto/assignees{/user}","branches_url":"https://api.github.com/repos/martint/presto/branches{/branch}","tags_url":"https://api.github.com/repos/martint/presto/tags","blobs_url":"https://api.github.com/repos/martint/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martint/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martint/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/martint/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martint/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/martint/presto/languages","stargazers_url":"https://api.github.com/repos/martint/presto/stargazers","contributors_url":"https://api.github.com/repos/martint/presto/contributors","subscribers_url":"https://api.github.com/repos/martint/presto/subscribers","subscription_url":"https://api.github.com/repos/martint/presto/subscription","commits_url":"https://api.github.com/repos/martint/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/martint/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/martint/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/martint/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/martint/presto/contents/{+path}","compare_url":"https://api.github.com/repos/martint/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martint/presto/merges","archive_url":"https://api.github.com/repos/martint/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martint/presto/downloads","issues_url":"https://api.github.com/repos/martint/presto/issues{/number}","pulls_url":"https://api.github.com/repos/martint/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/martint/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/martint/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martint/presto/labels{/name}","releases_url":"https://api.github.com/repos/martint/presto/releases{/id}","created_at":"2012-08-21T17:22:50Z","updated_at":"2014-06-21T01:05:38Z","pushed_at":"2015-11-06T22:21:00Z","git_url":"git://github.com/martint/presto.git","ssh_url":"git@github.com:martint/presto.git","clone_url":"https://github.com/martint/presto.git","svn_url":"https://github.com/martint/presto","homepage":null,"size":39428,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"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":"8f2aa8b1cb59a19a677da78b9f2c3bbb00981a88","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-11-06T14:53:17Z","pushed_at":"2015-11-06T22:47:01Z","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":146258,"stargazers_count":4061,"watchers_count":4061,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1064,"mirror_url":null,"open_issues_count":350,"forks":1064,"open_issues":350,"watchers":4061,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/3911"},"html":{"href":"https://github.com/facebook/presto/pull/3911"},"issue":{"href":"https://api.github.com/repos/facebook/presto/issues/3911"},"comments":{"href":"https://api.github.com/repos/facebook/presto/issues/3911/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/presto/pulls/3911/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/presto/pulls/3911/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/presto/statuses/0a6ac23712092f69d1f37aeca11a9c17ce2334a2"}}}}