org.apache.tez.runtime.api
Interface Output

All Known Subinterfaces:
LogicalOutput

public interface Output

Represents an Output through which a TezProcessor writes information on an edge.

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

During initialization, Outputs must specify an initial memory requirement via TezOutputContext.requestInitialMemory


Method Summary
 List<Event> close()
          Closes the Output
 Writer getWriter()
          Gets an instance of the Writer in an Output
 void handleEvents(List<Event> outputEvents)
          Handles user and system generated Events, which typically carry information such as a downstream vertex being ready to consume input.
 List<Event> initialize(TezOutputContext outputContext)
          Initializes the Output
 void start()
          Start any processing that the Output may need to perform.
 

Method Detail

initialize

List<Event> initialize(TezOutputContext outputContext)
                       throws Exception
Initializes the Output

Parameters:
outputContext - the TezOutputContext
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 Output may need to perform. It is the responsibility of the Processor to start Outputs. This typically acts as a signal to Outputs to start any Processing that they may required. This method may be invoked by the framework under certain circumstances, and as such requires the implementation to be non-blocking. Outputs must be written to handle multiple start invocations - typically honoring only the first one.

Throws:
Exception

getWriter

Writer getWriter()
                 throws Exception
Gets an instance of the Writer in an Output

Returns:
Gets an instance of the Writer in an Output
Throws:
Exception - if an error occurs

handleEvents

void handleEvents(List<Event> outputEvents)
Handles user and system generated Events, which typically carry information such as a downstream vertex being ready to consume input.

Parameters:
outputEvents - the list of Events

close

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

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


Copyright © 2014 Apache Software Foundation. All rights reserved.