org.apache.tez.runtime.api
Class MergedLogicalInput

java.lang.Object
  extended by org.apache.tez.runtime.api.MergedLogicalInput
All Implemented Interfaces:
Input, LogicalInput

public abstract class MergedLogicalInput
extends Object
implements LogicalInput

A LogicalInput that is used to merge the data from multiple inputs and provide a single Reader to read that data. This Input is not initialized or closed. It is only expected to provide a merged view of the real inputs. It cannot send or receive events


Constructor Summary
MergedLogicalInput()
           
 
Method Summary
 List<Event> close()
          Closes the Input
 List<Input> getInputs()
           
 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.
protected  void informInputReady()
          Used by the actual MergedInput to notify that it's ready for consumption.
 void initialize(List<Input> inputs)
           
 List<Event> initialize(TezInputContext inputContext)
          Initializes the Input.
abstract  void setConstituentInputIsReady(Input input)
          Used by the framework to inform the MergedInput that one of it's constituent Inputs is ready.
 void setInputReadyCallback(InputReadyCallback callback)
           
 void setNumPhysicalInputs(int numInputs)
          Sets the number of physical inputs that this LogicalInput will receive.
 void start()
          Start any processing that the Input may need to perform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tez.runtime.api.Input
getReader
 

Constructor Detail

MergedLogicalInput

public MergedLogicalInput()
Method Detail

initialize

public final void initialize(List<Input> inputs)

getInputs

public final List<Input> getInputs()

initialize

public final List<Event> initialize(TezInputContext inputContext)
                             throws Exception
Description copied from interface: Input
Initializes the Input.

Specified by:
initialize in interface Input
Parameters:
inputContext - the TezInputContext
Returns:
list of events that were generated during initialization
Throws:
Exception - if an error occurs

start

public final void start()
                 throws Exception
Description copied from interface: Input
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.

Specified by:
start in interface Input
Throws:
Exception

handleEvents

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

Specified by:
handleEvents in interface Input
Parameters:
inputEvents - the list of Events
Throws:
Exception

close

public final List<Event> close()
                        throws Exception
Description copied from interface: Input
Closes the Input

Specified by:
close in interface Input
Returns:
list of events that were generated during close
Throws:
Exception - if an error occurs

setNumPhysicalInputs

public final void setNumPhysicalInputs(int numInputs)
Description copied from interface: LogicalInput
Sets the number of physical inputs that this LogicalInput will receive. This will be called by the Tez framework before initializing the LogicalInput

Specified by:
setNumPhysicalInputs in interface LogicalInput
Parameters:
numInputs - the number of physical inputs.

setInputReadyCallback

public void setInputReadyCallback(InputReadyCallback callback)

informInputReady

protected final void informInputReady()
Used by the actual MergedInput to notify that it's ready for consumption. TBD eventually via the context.


setConstituentInputIsReady

public abstract void setConstituentInputIsReady(Input input)
Used by the framework to inform the MergedInput that one of it's constituent Inputs is ready.



Copyright © 2014 Apache Software Foundation. All rights reserved.