org.apache.pig.impl.streaming
Class OutputHandler

java.lang.Object
  extended by org.apache.pig.impl.streaming.OutputHandler
Direct Known Subclasses:
DefaultOutputHandler, FileOutputHandler

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.


Nested Class Summary
static class OutputHandler.OutputType
           
 
Field Summary
protected  boolean alreadyClosed
           
protected  StreamToPig deserializer
           
protected  org.apache.hadoop.util.LineReader in
           
 
Constructor Summary
OutputHandler()
           
 
Method Summary
 void bindTo(String fileName, BufferedPositionedInputStream is, long offset, long end)
          Bind the OutputHandler to the InputStream from which to read the output data of the managed process.
 void close()
          Close the OutputHandler.
 Tuple getNext()
          Get the next output Tuple of the managed process.
abstract  OutputHandler.OutputType getOutputType()
          Get the handled OutputType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deserializer

protected StreamToPig deserializer

in

protected org.apache.hadoop.util.LineReader in

alreadyClosed

protected boolean alreadyClosed
Constructor Detail

OutputHandler

public OutputHandler()
Method Detail

getOutputType

public abstract OutputHandler.OutputType getOutputType()
Get the handled OutputType.

Returns:
the handled OutputType

bindTo

public void bindTo(String fileName,
                   BufferedPositionedInputStream is,
                   long offset,
                   long end)
            throws IOException
Bind the OutputHandler to the InputStream from which to read the output data of the managed process.

Parameters:
is - InputStream from which to read the output data of the managed process
Throws:
IOException

getNext

public Tuple getNext()
              throws IOException
Get the next output Tuple of the managed process.

Returns:
the next output Tuple of the managed process
Throws:
IOException

close

public void close()
           throws IOException
Close the OutputHandler.

Throws:
IOException


Copyright © ${year} The Apache Software Foundation