Github user andreweduffy commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14201#discussion_r71036075
  
    --- Diff: 
launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java ---
    @@ -359,6 +369,83 @@ public SparkLauncher setVerbose(boolean verbose) {
       }
     
       /**
    +   * Sets the working directory of spark-submit.
    +   *
    +   * @param dir The directory to set as spark-submit's working directory.
    +   * @return This launcher.
    +     */
    +  public SparkLauncher directory(File dir) {
    +    workingDir = dir;
    +    return this;
    +  }
    +
    +  /**
    +   * Specifies that stderr in spark-submit should be redirected to stdout.
    +   *
    +   * @return This launcher.
    +   */
    +  public SparkLauncher redirectError() {
    +    redirectErrorStream = true;
    +    return this;
    +  }
    +
    +  /**
    +   * Redirects error output to the specified Redirect.
    +   *
    +   * @param to The method of redirection.
    +   * @return This launcher.
    +   */
    +  public SparkLauncher redirectError(ProcessBuilder.Redirect to) {
    +    errorStream = to;
    +    return this;
    +  }
    +
    +  /**
    +   * Redirects standard output to the specified Redirect.
    +   *
    +   * @param to The method of redirection.
    +   * @return This launcher.
    +   */
    +  public SparkLauncher redirectOutput(ProcessBuilder.Redirect to) {
    +    outputStream = to;
    +    return this;
    +  }
    +
    +  /**
    +   * Redirects error output to the specified File.
    +   *
    +   * @param errFile The file to which stderr is written.
    +   * @return This launcher.
    +   */
    +  public SparkLauncher redirectError(File errFile) {
    +    errorStream = ProcessBuilder.Redirect.to(errFile);
    +    return this;
    +  }
    +
    +  /**
    +   * Redirects error output to the specified File.
    +   *
    +   * @param outFile The file to which stdout is written.
    +   * @return This launcher.
    +   */
    +  public SparkLauncher redirectOutput(File outFile) {
    +    outputStream = ProcessBuilder.Redirect.to(outFile);
    +    return this;
    +  }
    +
    +  /**
    +   * Sets all output to be logged and redirected to a logger with the 
specified name.
    +   *
    +   * @param loggerName The name of the logger to log stdout and stderr.
    +   * @return This launcher.
    +     */
    +  public SparkLauncher redirectToLog(String loggerName) {
    --- End diff --
    
    Yep, that's what I'm saying with the second point above, so those two 
should probably be good enough


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to