org.apache.tez.runtime.api
Interface Input

All Known Subinterfaces:
LogicalInput
All Known Implementing Classes:
MergedLogicalInput

public interface Input

Represents an input through which a TezProcessor receives data on an edge.

Input classes must have a 0 argument public constructor for Tez to construct the Input. Tez will take care of initializing and closing the Input after a Processor completes.

During initialization, Inputs must specify an initial memory requirement via TezInputContext.requestInitialMemory Inputs must also inform the framework once they are ready to be consumed. This typically means that the Processor will not block when reading from the corresponding Input. This is done via TezInputContext.inputIsReady. Inputs choose the policy on when they are ready.


Method Summary
 List<Event> close()
          Closes the Input
 Reader getReader()
          Gets an instance of the Reader for this Output
 void handleEvents(List<Event> inputEvents)
          Handles user and system generated Events, which typically carry information such as an output being available on the previous vertex.
 List<Event> initialize(TezInputContext inputContext)
          Initializes the Input.
 void start()
          Start any processing that the Input may need to perform.
 

Method Detail

initialize

List<Event> initialize(TezInputContext inputContext)
                       throws Exception
Initializes the Input.

Parameters:
inputContext - the TezInputContext
Returns:
list of events that were generated during initialization
Throws:
Exception - if an error occurs

start

void start()
           throws Exception
Start any processing that the Input may need to perform. It is the responsibility of the Processor to start Inputs. This typically acts as a signal to Inputs to start any Processing that they may required. A blocking implementation of this method should not be used as a mechanism to determine when an Input is actually ready. This method may be invoked by the framework under certain circumstances, and as such requires the implementation to be non-blocking. Inputs must be written to handle multiple start invocations - typically honoring only the first one.

Throws:
Exception

getReader

Reader getReader()
                 throws Exception
Gets an instance of the Reader for this Output

Returns:
Gets an instance of the Reader for this Output
Throws:
Exception - if an error occurs

handleEvents

void handleEvents(List<Event> inputEvents)
                  throws Exception
Handles user and system generated Events, which typically carry information such as an output being available on the previous vertex.

Parameters:
inputEvents - the list of Events
Throws:
Exception

close

List<Event> close()
                  throws Exception
Closes the Input

Returns:
list of events that were generated during close
Throws:
Exception - if an error occurs


Copyright © 2014 Apache Software Foundation. All rights reserved.