Re: SparkAppHandle - get Input and output streams

2017-05-18 Thread Marcelo Vanzin
On Thu, May 18, 2017 at 10:10 AM, Nipun Arora  wrote:
> I wanted to know how to get the the input and output streams from
> SparkAppHandle?

You can't. You can redirect the output, but not directly get the streams.

-- 
Marcelo

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org



SparkAppHandle - get Input and output streams

2017-05-18 Thread Nipun Arora
Hi,

I wanted to know how to get the the input and output streams from
SparkAppHandle?
I start application like the following:

SparkAppHandle sparkAppHandle = sparkLauncher.startApplication();

I have used the following previously to capture inputstream from error and
output streams, but I would like to know how to do the same for
SparkAppHandle.

Process process= sparkLauncher.launch();

InputStreamReaderRunnable inputStreamReaderRunnable = new
InputStreamReaderRunnable(process.getInputStream(), "input");
Thread inputThread = new Thread(inputStreamReaderRunnable,
"LogStreamReader input");
inputThread.start();

InputStreamReaderRunnable errorStreamReaderRunnable = new
InputStreamReaderRunnable(process.getErrorStream(), "error");
Thread errorThread = new Thread(errorStreamReaderRunnable,
"LogStreamReader error");
errorThread.start();


Thanks
Nipun