public abstract class OutputHandler
extends java.lang.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 java.lang.Object |
END_OF_OUTPUT |
protected org.apache.hadoop.util.LineReader |
in |
Constructor and Description |
---|
OutputHandler() |
Modifier and Type | Method and Description |
---|---|
void |
bindTo(java.lang.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 . |
protected byte[] |
getRecordDelimiter() |
public static final java.lang.Object END_OF_OUTPUT
protected StreamToPig deserializer
protected org.apache.hadoop.util.LineReader in
protected boolean alreadyClosed
public abstract OutputHandler.OutputType getOutputType()
OutputType
.OutputType
public void bindTo(java.lang.String fileName, BufferedPositionedInputStream is, long offset, long end) throws java.io.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 processjava.io.IOException
public Tuple getNext() throws java.io.IOException
Tuple
of the managed process.Tuple
of the managed processjava.io.IOException
protected byte[] getRecordDelimiter()
public void close() throws java.io.IOException
OutputHandler
.java.io.IOException
Copyright © 2007-2017 The Apache Software Foundation