org.apache.pig.impl.streaming
Class OutputHandler
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
deserializer
protected StreamToPig deserializer
in
protected org.apache.hadoop.util.LineReader in
alreadyClosed
protected boolean alreadyClosed
OutputHandler
public OutputHandler()
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 © 2012 The Apache Software Foundation