{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments/145021576","pull_request_review_id":69759143,"id":145021576,"diff_hunk":"@@ -0,0 +1,83 @@\n+/*\n+ * Copyright (c) Microsoft Corporation\n+ * <p/>\n+ * All rights reserved.\n+ * <p/>\n+ * MIT License\n+ * <p/>\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n+ * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n+ * <p/>\n+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n+ * the Software.\n+ * <p/>\n+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ */\n+\n+package com.microsoft.azure.hdinsight.spark.mock;\n+\n+\n+import mockit.Invocation;\n+import mockit.Mock;\n+import mockit.MockUp;\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.fs.FileSystem;\n+import org.apache.hadoop.fs.Path;\n+\n+import java.lang.reflect.InvocationTargetException;\n+import java.lang.reflect.Method;\n+import java.util.Arrays;\n+import java.util.List;\n+\n+public class SparkLocalRunner {\n+    public static void main(String[] args) {\n+        SparkLocalRunner localRunner = new SparkLocalRunner();\n+\n+        localRunner.setUp();\n+        localRunner.runJobMain(Arrays.asList(args));\n+    }\n+\n+    private void runJobMain(List<String> args) {\n+\n+        System.out.println(\"HADOOP_HOME: \" + System.getenv(\"HADOOP_HOME\"));\n+        System.out.println(\"Hadoop user default directory: \" + System.getProperty(\"user.dir\"));\n+\n+        String jobClassName = args.get(0);\n+\n+        try {\n+            final Class<?> jobClass = Class.forName(jobClassName);\n+\n+            System.out.println(\"Run Spark Job: \" + jobClass.getName());\n+\n+            final Method jobMain = jobClass.getMethod(\"main\", String[].class);\n+\n+            final Object[] jobArgs = new Object[]{ args.subList(1, args.size()).toArray(new String[0]) };\n+            jobMain.invoke(null, jobArgs);\n+        } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {\n+            e.printStackTrace();\n+        }\n+\n+    }\n+\n+    private void setUp() {\n+\n+        new MockUp<FileSystem>() {\n+\n+            @Mock\n+            public Class getFileSystemClass(Invocation invocation, String scheme, Configuration conf) {\n+                return MockDfs.class;\n+            }\n+\n+            @Mock\n+            public void checkPath(Path path) {}\n+        };\n+\n+        System.setProperty(\"spark.master\", \"local[2]\");","path":"Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/spark/mock/SparkLocalRunner.java","position":80,"original_position":80,"commit_id":"6f375dc605e8e25cc5f8b0784ea301882a95f39e","original_commit_id":"6f375dc605e8e25cc5f8b0784ea301882a95f39e","user":{"login":"wezhang","id":7385667,"avatar_url":"https://avatars0.githubusercontent.com/u/7385667?v=4","gravatar_id":"","url":"https://api.github.com/users/wezhang","html_url":"https://github.com/wezhang","followers_url":"https://api.github.com/users/wezhang/followers","following_url":"https://api.github.com/users/wezhang/following{/other_user}","gists_url":"https://api.github.com/users/wezhang/gists{/gist_id}","starred_url":"https://api.github.com/users/wezhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezhang/subscriptions","organizations_url":"https://api.github.com/users/wezhang/orgs","repos_url":"https://api.github.com/users/wezhang/repos","events_url":"https://api.github.com/users/wezhang/events{/privacy}","received_events_url":"https://api.github.com/users/wezhang/received_events","type":"User","site_admin":false},"body":"Good catch! It's under development!","created_at":"2017-10-17T03:44:10Z","updated_at":"2017-10-17T03:44:10Z","html_url":"https://github.com/Microsoft/azure-tools-for-java/pull/1123#discussion_r145021576","pull_request_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments/145021576"},"html":{"href":"https://github.com/Microsoft/azure-tools-for-java/pull/1123#discussion_r145021576"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123"}},"in_reply_to_id":144797556},"pull_request":{"url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123","id":146701819,"html_url":"https://github.com/Microsoft/azure-tools-for-java/pull/1123","diff_url":"https://github.com/Microsoft/azure-tools-for-java/pull/1123.diff","patch_url":"https://github.com/Microsoft/azure-tools-for-java/pull/1123.patch","issue_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/1123","number":1123,"state":"open","locked":false,"title":"[pre-review] Combine Spark Job Local and Cluster run configuration","user":{"login":"wezhang","id":7385667,"avatar_url":"https://avatars0.githubusercontent.com/u/7385667?v=4","gravatar_id":"","url":"https://api.github.com/users/wezhang","html_url":"https://github.com/wezhang","followers_url":"https://api.github.com/users/wezhang/followers","following_url":"https://api.github.com/users/wezhang/following{/other_user}","gists_url":"https://api.github.com/users/wezhang/gists{/gist_id}","starred_url":"https://api.github.com/users/wezhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezhang/subscriptions","organizations_url":"https://api.github.com/users/wezhang/orgs","repos_url":"https://api.github.com/users/wezhang/repos","events_url":"https://api.github.com/users/wezhang/events{/privacy}","received_events_url":"https://api.github.com/users/wezhang/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-16T05:56:56Z","updated_at":"2017-10-17T03:44:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"580b3a0d4c0b277a9b7195406b183b8da8a7b44f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ziyel","id":1286176,"avatar_url":"https://avatars1.githubusercontent.com/u/1286176?v=4","gravatar_id":"","url":"https://api.github.com/users/ziyel","html_url":"https://github.com/ziyel","followers_url":"https://api.github.com/users/ziyel/followers","following_url":"https://api.github.com/users/ziyel/following{/other_user}","gists_url":"https://api.github.com/users/ziyel/gists{/gist_id}","starred_url":"https://api.github.com/users/ziyel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziyel/subscriptions","organizations_url":"https://api.github.com/users/ziyel/orgs","repos_url":"https://api.github.com/users/ziyel/repos","events_url":"https://api.github.com/users/ziyel/events{/privacy}","received_events_url":"https://api.github.com/users/ziyel/received_events","type":"User","site_admin":false},{"login":"djlan","id":26966861,"avatar_url":"https://avatars1.githubusercontent.com/u/26966861?v=4","gravatar_id":"","url":"https://api.github.com/users/djlan","html_url":"https://github.com/djlan","followers_url":"https://api.github.com/users/djlan/followers","following_url":"https://api.github.com/users/djlan/following{/other_user}","gists_url":"https://api.github.com/users/djlan/gists{/gist_id}","starred_url":"https://api.github.com/users/djlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djlan/subscriptions","organizations_url":"https://api.github.com/users/djlan/orgs","repos_url":"https://api.github.com/users/djlan/repos","events_url":"https://api.github.com/users/djlan/events{/privacy}","received_events_url":"https://api.github.com/users/djlan/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123/commits","review_comments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123/comments","review_comment_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/1123/comments","statuses_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/statuses/6f375dc605e8e25cc5f8b0784ea301882a95f39e","head":{"label":"wezhang:local_run_review","ref":"local_run_review","sha":"6f375dc605e8e25cc5f8b0784ea301882a95f39e","user":{"login":"wezhang","id":7385667,"avatar_url":"https://avatars0.githubusercontent.com/u/7385667?v=4","gravatar_id":"","url":"https://api.github.com/users/wezhang","html_url":"https://github.com/wezhang","followers_url":"https://api.github.com/users/wezhang/followers","following_url":"https://api.github.com/users/wezhang/following{/other_user}","gists_url":"https://api.github.com/users/wezhang/gists{/gist_id}","starred_url":"https://api.github.com/users/wezhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezhang/subscriptions","organizations_url":"https://api.github.com/users/wezhang/orgs","repos_url":"https://api.github.com/users/wezhang/repos","events_url":"https://api.github.com/users/wezhang/events{/privacy}","received_events_url":"https://api.github.com/users/wezhang/received_events","type":"User","site_admin":false},"repo":{"id":91043464,"name":"azure-tools-for-java","full_name":"wezhang/azure-tools-for-java","owner":{"login":"wezhang","id":7385667,"avatar_url":"https://avatars0.githubusercontent.com/u/7385667?v=4","gravatar_id":"","url":"https://api.github.com/users/wezhang","html_url":"https://github.com/wezhang","followers_url":"https://api.github.com/users/wezhang/followers","following_url":"https://api.github.com/users/wezhang/following{/other_user}","gists_url":"https://api.github.com/users/wezhang/gists{/gist_id}","starred_url":"https://api.github.com/users/wezhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezhang/subscriptions","organizations_url":"https://api.github.com/users/wezhang/orgs","repos_url":"https://api.github.com/users/wezhang/repos","events_url":"https://api.github.com/users/wezhang/events{/privacy}","received_events_url":"https://api.github.com/users/wezhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wezhang/azure-tools-for-java","description":"Azure tools for Java, including Azure Toolkits for Eclipse, IntelliJ and related projects.","fork":true,"url":"https://api.github.com/repos/wezhang/azure-tools-for-java","forks_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/forks","keys_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/teams","hooks_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/hooks","issue_events_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/events","assignees_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/tags","blobs_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/languages","stargazers_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/stargazers","contributors_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/contributors","subscribers_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/subscribers","subscription_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/subscription","commits_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/merges","archive_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/downloads","issues_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/labels{/name}","releases_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/wezhang/azure-tools-for-java/deployments","created_at":"2017-05-12T02:37:36Z","updated_at":"2017-05-12T02:37:41Z","pushed_at":"2017-10-16T08:44:03Z","git_url":"git://github.com/wezhang/azure-tools-for-java.git","ssh_url":"git@github.com:wezhang/azure-tools-for-java.git","clone_url":"https://github.com/wezhang/azure-tools-for-java.git","svn_url":"https://github.com/wezhang/azure-tools-for-java","homepage":null,"size":88612,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:develop","ref":"develop","sha":"ae8ab69102dbd1f6f65101d6704711c4b7b9f92a","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":53603813,"name":"azure-tools-for-java","full_name":"Microsoft/azure-tools-for-java","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/azure-tools-for-java","description":"Azure tools for Java, including Azure Toolkits for Eclipse, IntelliJ and related projects.","fork":false,"url":"https://api.github.com/repos/Microsoft/azure-tools-for-java","forks_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/forks","keys_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/teams","hooks_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/events","assignees_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/tags","blobs_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/languages","stargazers_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/subscription","commits_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/merges","archive_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/downloads","issues_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/azure-tools-for-java/deployments","created_at":"2016-03-10T17:29:21Z","updated_at":"2017-10-16T05:05:14Z","pushed_at":"2017-10-17T01:13:01Z","git_url":"git://github.com/Microsoft/azure-tools-for-java.git","ssh_url":"git@github.com:Microsoft/azure-tools-for-java.git","clone_url":"https://github.com/Microsoft/azure-tools-for-java.git","svn_url":"https://github.com/Microsoft/azure-tools-for-java","homepage":null,"size":88672,"stargazers_count":66,"watchers_count":66,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":143,"forks":42,"open_issues":143,"watchers":66,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123"},"html":{"href":"https://github.com/Microsoft/azure-tools-for-java/pull/1123"},"issue":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/1123"},"comments":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/issues/1123/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/pulls/1123/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/azure-tools-for-java/statuses/6f375dc605e8e25cc5f8b0784ea301882a95f39e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"wezhang"}}