public abstract class OutputHandler extends Object
OutputHandler is responsible for handling the output of the
 Pig-Streaming external command.
 The output of the managed executable could be fetched in a
 OutputHandler.OutputType.SYNCHRONOUS manner via its stdout or in an
 OutputHandler.OutputType.ASYNCHRONOUS manner via an external file to which the
 process wrote its output.| Modifier and Type | Class and Description | 
|---|---|
| static class  | OutputHandler.OutputType | 
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | alreadyClosed | 
| protected StreamToPig | deserializer | 
| static Object | END_OF_OUTPUT | 
| protected org.apache.hadoop.util.LineReader | in | 
| Constructor and Description | 
|---|
| OutputHandler() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | bindTo(String fileName,
      BufferedPositionedInputStream is,
      long offset,
      long end)Bind the  OutputHandlerto theInputStreamfrom which to read the output data of the managed process. | 
| void | close()Close the  OutputHandler. | 
| Tuple | getNext()Get the next output  Tupleof the managed process. | 
| abstract OutputHandler.OutputType | getOutputType()Get the handled  OutputType. | 
| protected byte[] | getRecordDelimiter() | 
public static final Object END_OF_OUTPUT
protected StreamToPig deserializer
protected org.apache.hadoop.util.LineReader in
protected boolean alreadyClosed
public abstract OutputHandler.OutputType getOutputType()
OutputType.OutputTypepublic void bindTo(String fileName, BufferedPositionedInputStream is, long offset, long end) throws IOException
OutputHandler to the InputStream
 from which to read the output data of the managed process.is - InputStream from which to read the output data
           of the managed processIOExceptionpublic Tuple getNext() throws IOException
Tuple of the managed process.Tuple of the managed processIOExceptionprotected byte[] getRecordDelimiter()
public void close()
           throws IOException
OutputHandler.IOExceptionCopyright © 2007-2017 The Apache Software Foundation