org.apache.pig.impl.streaming
Class InputHandler
java.lang.Object
org.apache.pig.impl.streaming.InputHandler
- Direct Known Subclasses:
- DefaultInputHandler, FileInputHandler
public abstract class InputHandler
- extends Object
InputHandler
is responsible for handling the input to the
Pig-Streaming external command.
The managed executable could be fed input in a InputHandler.InputType.SYNCHRONOUS
manner via its stdin
or in an InputHandler.InputType.ASYNCHRONOUS
manner via an external file which is subsequently read by the executable.
Method Summary |
void |
bindTo(OutputStream os)
Bind the InputHandler to the OutputStream
from which it reads input and sends it to the managed process. |
void |
close()
Close the InputHandler since there is no more input
to be sent to the managed process. |
abstract InputHandler.InputType |
getInputType()
Get the handled InputType |
void |
putNext(Tuple t)
Send the given input Tuple to the managed executable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serializer
protected StoreFunc serializer
InputHandler
public InputHandler()
getInputType
public abstract InputHandler.InputType getInputType()
- Get the handled
InputType
- Returns:
- the handled
InputType
putNext
public void putNext(Tuple t)
throws IOException
- Send the given input
Tuple
to the managed executable.
- Parameters:
t
- input Tuple
- Throws:
IOException
close
public void close()
throws IOException
- Close the
InputHandler
since there is no more input
to be sent to the managed process.
- Throws:
IOException
bindTo
public void bindTo(OutputStream os)
throws IOException
- Bind the
InputHandler
to the OutputStream
from which it reads input and sends it to the managed process.
- Parameters:
os
- OutputStream
from which to read input data for the
managed process
- Throws:
IOException
Copyright © ${year} The Apache Software Foundation