Github user shzhng commented on the pull request:

    https://github.com/apache/spark/pull/12474#issuecomment-211519971
  
    @rxin yep, we need the ability to set the working directory of the 
`SparkLauncher.launch` call, as well as piping output and error streams to 
various files. Simply giving the user the Process created from the 
ProcessBuilder grants them none of this flexibility.
    
    There are hacky ways to do both, such as manually grabbing the InputStreams 
and ErrorStreams, getting the byte arrays of the output, then byte syncing it 
out to a file with Guava's ByteStreams (example here: 
http://stackoverflow.com/a/17095886). Setting the working directory is even 
hackier as it involves messing with `System.properties("user.dir")`, something 
you should generally avoid messing with. All of this is simplified with the 
ProcessBuilder.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to