org.apache.tez.runtime.api
Interface TezProcessorContext

All Superinterfaces:
TezTaskContext

public interface TezProcessorContext
extends TezTaskContext

Context handle for the Processor to initialize itself.


Method Summary
 boolean canCommit()
          Check whether this attempt can commit its output
 void setProgress(float progress)
          Set the overall progress of this Task Attempt
 void waitForAllInputsReady(Collection<Input> inputs)
          Blocking call which returns only after all of the specified Inputs are ready for consumption.
 Input waitForAnyInputReady(Collection<Input> inputs)
          Blocking call which returns when any of the specified Inputs is ready for consumption.
 
Methods inherited from interface org.apache.tez.runtime.api.TezTaskContext
fatalError, getApplicationId, getCounters, getDAGAttemptNumber, getDAGName, getServiceConsumerMetaData, getServiceProviderMetaData, getTaskAttemptNumber, getTaskIndex, getTaskVertexIndex, getTaskVertexName, getTotalMemoryAvailableToTask, getUniqueIdentifier, getUserPayload, getWorkDirs, requestInitialMemory, sendEvents
 

Method Detail

setProgress

void setProgress(float progress)
Set the overall progress of this Task Attempt

Parameters:
progress - Progress in the range from [0.0 - 1.0f]

canCommit

boolean canCommit()
                  throws IOException
Check whether this attempt can commit its output

Returns:
true if commit allowed
Throws:
IOException

waitForAnyInputReady

Input waitForAnyInputReady(Collection<Input> inputs)
                           throws InterruptedException
Blocking call which returns when any of the specified Inputs is ready for consumption. There can be multiple parallel invocations of this function - where each invocation blocks on the Inputs that it specifies. If multiple Inputs are ready, any one of them may be returned by this method - including an Input which may have been returned in a previous call. If invoking this method multiple times, it's recommended to remove previously completed Inputs from the invocation list.

Parameters:
inputs - the list of Inputs to monitor
Returns:
the Input which is ready for consumption
Throws:
InterruptedException

waitForAllInputsReady

void waitForAllInputsReady(Collection<Input> inputs)
                           throws InterruptedException
Blocking call which returns only after all of the specified Inputs are ready for consumption. There can be multiple parallel invocations of this function - where each invocation blocks on the Inputs that it specifies.

Parameters:
inputs - the list of Inputs to monitor
Throws:
InterruptedException


Copyright © 2014 Apache Software Foundation. All rights reserved.