org.apache.pig.impl.streaming
Class FileInputHandler

java.lang.Object
  extended by org.apache.pig.impl.streaming.InputHandler
      extended by org.apache.pig.impl.streaming.FileInputHandler

public class FileInputHandler
extends InputHandler

FileInputHandler handles the input for the Pig-Streaming executable in an asynchronous manner by feeding it input via an external file specified by the user.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pig.impl.streaming.InputHandler
InputHandler.InputType
 
Field Summary
 
Fields inherited from class org.apache.pig.impl.streaming.InputHandler
alreadyClosed, serializer
 
Constructor Summary
FileInputHandler(StreamingCommand.HandleSpec handleSpec)
           
 
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(Process process)
          Close the InputHandler since there is no more input to be sent to the managed process.
 InputHandler.InputType getInputType()
          Get the handled InputType
 
Methods inherited from class org.apache.pig.impl.streaming.InputHandler
putNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInputHandler

public FileInputHandler(StreamingCommand.HandleSpec handleSpec)
                 throws ExecException
Throws:
ExecException
Method Detail

getInputType

public InputHandler.InputType getInputType()
Description copied from class: InputHandler
Get the handled InputType

Specified by:
getInputType in class InputHandler
Returns:
the handled InputType

bindTo

public void bindTo(OutputStream os)
            throws IOException
Description copied from class: InputHandler
Bind the InputHandler to the OutputStream from which it reads input and sends it to the managed process.

Overrides:
bindTo in class InputHandler
Parameters:
os - OutputStream from which to read input data for the managed process
Throws:
IOException

close

public void close(Process process)
           throws IOException
Description copied from class: InputHandler
Close the InputHandler since there is no more input to be sent to the managed process.

Overrides:
close in class InputHandler
Parameters:
process - the managed process - this could be null in some cases like when input is through files. In that case, the process would not have been exec'ed yet - if this method if overridden it is the responsibility of the implementer to check that the process is usable. The managed process object is supplied by the ExecutableManager to this call so that this method can check if the process is alive if it needs to know.
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation