Package com.cloudera.util

Examples of com.cloudera.util.InputStreamPipe


  void startup() throws IOException {
    selector = Selector.open();

    rt = Runtime.getRuntime();
    proc = rt.exec(args);
    outPipe = new InputStreamPipe(proc.getInputStream());
    errPipe = new InputStreamPipe(proc.getErrorStream());
    if (interactive) {
      watchdogPipe = new InputStreamPipe(System.in);
      procIn = new PrintStream(proc.getOutputStream());
    }

    stdout = outPipe.getChannel();
    stderr = errPipe.getChannel();
View Full Code Here


    errFinished.set(false);
    proc = Runtime.getRuntime().exec(command);

    // Just reading from stdout and stderr can block, so we wrap them with
    // InputStreamPipe allows them to be nonblocking.
    stdinISP = new InputStreamPipe(proc.getInputStream());
    stderrISP = new InputStreamPipe(proc.getErrorStream());
    stdout = (ReadableByteChannel) stdinISP.getChannel();
    stderr = (ReadableByteChannel) stderrISP.getChannel();

    readOut = new ReaderThread(stdout, "STDOUT", outFinished);
    readErr = new ReaderThread(stderr, "STDERR", errFinished);
View Full Code Here

    errFinished.set(false);
    proc = Runtime.getRuntime().exec(command);

    // Just reading from stdout and stderr can block, so we wrap them with
    // InputStreamPipe allows them to be nonblocking.
    stdinISP = new InputStreamPipe(proc.getInputStream());
    stderrISP = new InputStreamPipe(proc.getErrorStream());
    stdout = (ReadableByteChannel) stdinISP.getChannel();
    stderr = (ReadableByteChannel) stderrISP.getChannel();

    readOut = new ReaderThread(stdout, "STDOUT", outFinished);
    readErr = new ReaderThread(stderr, "STDERR", errFinished);
View Full Code Here

    errFinished.set(false);
    proc = Runtime.getRuntime().exec(command);

    // Just reading from stdout and stderr can block, so we wrap them with
    // InputSTreamPipe allows them to be nonblocking.
    stdinISP = new InputStreamPipe(proc.getInputStream());
    stderrISP = new InputStreamPipe(proc.getErrorStream());
    stdout = (ReadableByteChannel) stdinISP.getChannel();
    stderr = (ReadableByteChannel) stderrISP.getChannel();

    readOut = new ReaderThread(stdout, "STDOUT", outFinished);
    readErr = new ReaderThread(stderr, "STDERR", errFinished);
View Full Code Here

    outFinished.set(false);
    errFinished.set(false);
    proc = Runtime.getRuntime().exec(command);

    try {
      stdinISP = new InputStreamPipe(proc.getInputStream());
      stderrISP = new InputStreamPipe(proc.getErrorStream());
      stdout = (ReadableByteChannel) stdinISP.getChannel();
      stderr = (ReadableByteChannel) stderrISP.getChannel();
    } catch (IOException e) {
      proc.getInputStream().close();
      proc.getErrorStream().close();
View Full Code Here

TOP

Related Classes of com.cloudera.util.InputStreamPipe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.