{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/71032896","id":71032896,"diff_hunk":"@@ -359,6 +369,83 @@ public SparkLauncher setVerbose(boolean verbose) {\n   }\n \n   /**\n+   * Sets the working directory of spark-submit.\n+   *\n+   * @param dir The directory to set as spark-submit's working directory.\n+   * @return This launcher.\n+     */\n+  public SparkLauncher directory(File dir) {\n+    workingDir = dir;\n+    return this;\n+  }\n+\n+  /**\n+   * Specifies that stderr in spark-submit should be redirected to stdout.\n+   *\n+   * @return This launcher.\n+   */\n+  public SparkLauncher redirectError() {\n+    redirectErrorStream = true;\n+    return this;\n+  }\n+\n+  /**\n+   * Redirects error output to the specified Redirect.\n+   *\n+   * @param to The method of redirection.\n+   * @return This launcher.\n+   */\n+  public SparkLauncher redirectError(ProcessBuilder.Redirect to) {\n+    errorStream = to;\n+    return this;\n+  }\n+\n+  /**\n+   * Redirects standard output to the specified Redirect.\n+   *\n+   * @param to The method of redirection.\n+   * @return This launcher.\n+   */\n+  public SparkLauncher redirectOutput(ProcessBuilder.Redirect to) {\n+    outputStream = to;\n+    return this;\n+  }\n+\n+  /**\n+   * Redirects error output to the specified File.\n+   *\n+   * @param errFile The file to which stderr is written.\n+   * @return This launcher.\n+   */\n+  public SparkLauncher redirectError(File errFile) {\n+    errorStream = ProcessBuilder.Redirect.to(errFile);\n+    return this;\n+  }\n+\n+  /**\n+   * Redirects error output to the specified File.\n+   *\n+   * @param outFile The file to which stdout is written.\n+   * @return This launcher.\n+   */\n+  public SparkLauncher redirectOutput(File outFile) {\n+    outputStream = ProcessBuilder.Redirect.to(outFile);\n+    return this;\n+  }\n+\n+  /**\n+   * Sets all output to be logged and redirected to a logger with the specified name.\n+   *\n+   * @param loggerName The name of the logger to log stdout and stderr.\n+   * @return This launcher.\n+     */\n+  public SparkLauncher redirectToLog(String loggerName) {","path":"launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java","position":107,"original_position":107,"commit_id":"fa59b498a417ad51207314698e92c178c942dc5f","original_commit_id":"fa59b498a417ad51207314698e92c178c942dc5f","user":{"login":"vanzin","id":1694083,"avatar_url":"https://avatars.githubusercontent.com/u/1694083?v=3","gravatar_id":"","url":"https://api.github.com/users/vanzin","html_url":"https://github.com/vanzin","followers_url":"https://api.github.com/users/vanzin/followers","following_url":"https://api.github.com/users/vanzin/following{/other_user}","gists_url":"https://api.github.com/users/vanzin/gists{/gist_id}","starred_url":"https://api.github.com/users/vanzin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanzin/subscriptions","organizations_url":"https://api.github.com/users/vanzin/orgs","repos_url":"https://api.github.com/users/vanzin/repos","events_url":"https://api.github.com/users/vanzin/events{/privacy}","received_events_url":"https://api.github.com/users/vanzin/received_events","type":"User","site_admin":false},"body":"Could also check that `redirectError` and `redirectOutput` fail if `redirectToLog` has been set.\r\n\r\n(I see that I commented on a previous diff asking you to remove a check, sorry about that. I can't see the original code, though.)","created_at":"2016-07-15T20:02:10Z","updated_at":"2016-07-15T20:02:10Z","html_url":"https://github.com/apache/spark/pull/14201#discussion_r71032896","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/14201","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/71032896"},"html":{"href":"https://github.com/apache/spark/pull/14201#discussion_r71032896"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/14201"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14201","id":77454196,"html_url":"https://github.com/apache/spark/pull/14201","diff_url":"https://github.com/apache/spark/pull/14201.diff","patch_url":"https://github.com/apache/spark/pull/14201.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/14201","number":14201,"state":"open","locked":false,"title":"[SPARK-14702] Make environment of SparkLauncher launched process more configurable","user":{"login":"andreweduffy","id":332583,"avatar_url":"https://avatars.githubusercontent.com/u/332583?v=3","gravatar_id":"","url":"https://api.github.com/users/andreweduffy","html_url":"https://github.com/andreweduffy","followers_url":"https://api.github.com/users/andreweduffy/followers","following_url":"https://api.github.com/users/andreweduffy/following{/other_user}","gists_url":"https://api.github.com/users/andreweduffy/gists{/gist_id}","starred_url":"https://api.github.com/users/andreweduffy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreweduffy/subscriptions","organizations_url":"https://api.github.com/users/andreweduffy/orgs","repos_url":"https://api.github.com/users/andreweduffy/repos","events_url":"https://api.github.com/users/andreweduffy/events{/privacy}","received_events_url":"https://api.github.com/users/andreweduffy/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nAdds a few public methods to `SparkLauncher` to allow configuring some extra features of the `ProcessBuilder`, including the working directory, output and error stream redirection.\r\n\r\n## How was this patch tested?\r\n\r\nUnit testing + simple Spark driver programs","created_at":"2016-07-14T13:17:40Z","updated_at":"2016-07-15T20:02:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b3d2d799410d590b6a6d8b7ff95692f583a37a0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/14201/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/14201/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/14201/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/fa59b498a417ad51207314698e92c178c942dc5f","head":{"label":"andreweduffy:feature/launcher","ref":"feature/launcher","sha":"fa59b498a417ad51207314698e92c178c942dc5f","user":{"login":"andreweduffy","id":332583,"avatar_url":"https://avatars.githubusercontent.com/u/332583?v=3","gravatar_id":"","url":"https://api.github.com/users/andreweduffy","html_url":"https://github.com/andreweduffy","followers_url":"https://api.github.com/users/andreweduffy/followers","following_url":"https://api.github.com/users/andreweduffy/following{/other_user}","gists_url":"https://api.github.com/users/andreweduffy/gists{/gist_id}","starred_url":"https://api.github.com/users/andreweduffy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreweduffy/subscriptions","organizations_url":"https://api.github.com/users/andreweduffy/orgs","repos_url":"https://api.github.com/users/andreweduffy/repos","events_url":"https://api.github.com/users/andreweduffy/events{/privacy}","received_events_url":"https://api.github.com/users/andreweduffy/received_events","type":"User","site_admin":false},"repo":{"id":39734055,"name":"spark","full_name":"andreweduffy/spark","owner":{"login":"andreweduffy","id":332583,"avatar_url":"https://avatars.githubusercontent.com/u/332583?v=3","gravatar_id":"","url":"https://api.github.com/users/andreweduffy","html_url":"https://github.com/andreweduffy","followers_url":"https://api.github.com/users/andreweduffy/followers","following_url":"https://api.github.com/users/andreweduffy/following{/other_user}","gists_url":"https://api.github.com/users/andreweduffy/gists{/gist_id}","starred_url":"https://api.github.com/users/andreweduffy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreweduffy/subscriptions","organizations_url":"https://api.github.com/users/andreweduffy/orgs","repos_url":"https://api.github.com/users/andreweduffy/repos","events_url":"https://api.github.com/users/andreweduffy/events{/privacy}","received_events_url":"https://api.github.com/users/andreweduffy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreweduffy/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/andreweduffy/spark","forks_url":"https://api.github.com/repos/andreweduffy/spark/forks","keys_url":"https://api.github.com/repos/andreweduffy/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreweduffy/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreweduffy/spark/teams","hooks_url":"https://api.github.com/repos/andreweduffy/spark/hooks","issue_events_url":"https://api.github.com/repos/andreweduffy/spark/issues/events{/number}","events_url":"https://api.github.com/repos/andreweduffy/spark/events","assignees_url":"https://api.github.com/repos/andreweduffy/spark/assignees{/user}","branches_url":"https://api.github.com/repos/andreweduffy/spark/branches{/branch}","tags_url":"https://api.github.com/repos/andreweduffy/spark/tags","blobs_url":"https://api.github.com/repos/andreweduffy/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreweduffy/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreweduffy/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreweduffy/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreweduffy/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/andreweduffy/spark/languages","stargazers_url":"https://api.github.com/repos/andreweduffy/spark/stargazers","contributors_url":"https://api.github.com/repos/andreweduffy/spark/contributors","subscribers_url":"https://api.github.com/repos/andreweduffy/spark/subscribers","subscription_url":"https://api.github.com/repos/andreweduffy/spark/subscription","commits_url":"https://api.github.com/repos/andreweduffy/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreweduffy/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreweduffy/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreweduffy/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/andreweduffy/spark/contents/{+path}","compare_url":"https://api.github.com/repos/andreweduffy/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreweduffy/spark/merges","archive_url":"https://api.github.com/repos/andreweduffy/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreweduffy/spark/downloads","issues_url":"https://api.github.com/repos/andreweduffy/spark/issues{/number}","pulls_url":"https://api.github.com/repos/andreweduffy/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/andreweduffy/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/andreweduffy/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreweduffy/spark/labels{/name}","releases_url":"https://api.github.com/repos/andreweduffy/spark/releases{/id}","deployments_url":"https://api.github.com/repos/andreweduffy/spark/deployments","created_at":"2015-07-26T17:15:02Z","updated_at":"2016-06-28T20:48:51Z","pushed_at":"2016-07-15T16:44:45Z","git_url":"git://github.com/andreweduffy/spark.git","ssh_url":"git@github.com:andreweduffy/spark.git","clone_url":"https://github.com/andreweduffy/spark.git","svn_url":"https://github.com/andreweduffy/spark","homepage":null,"size":169106,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"71ad945bbbdd154eae852cd7f841e98f7a83e8d4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-07-15T19:37:53Z","pushed_at":"2016-07-15T18:55:47Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":500959,"stargazers_count":9312,"watchers_count":9312,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8640,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":435,"forks":8640,"open_issues":435,"watchers":9312,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/14201"},"html":{"href":"https://github.com/apache/spark/pull/14201"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/14201"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/14201/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/14201/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/14201/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/fa59b498a417ad51207314698e92c178c942dc5f"}}}}
{"actor":{"display_login":"vanzin"}}