@InterfaceAudience.Public
public interface TaskContext
| Modifier and Type | Method and Description | 
|---|---|
void | 
fatalError(Throwable exception,
          String message)
Report a fatal error to the framework. 
 | 
org.apache.hadoop.yarn.api.records.ApplicationId | 
getApplicationId()
Get the  
ApplicationId for the running app | 
TezCounters | 
getCounters()  | 
int | 
getDAGAttemptNumber()
Get the current DAG Attempt Number 
 | 
int | 
getDagIdentifier()
Get a numeric identifier for the dag to which the task belongs. 
 | 
String | 
getDAGName()
Get the name of the DAG 
 | 
ExecutionContext | 
getExecutionContext()
Get the context for the executor. 
 | 
ObjectRegistry | 
getObjectRegistry()
Returns a shared  
ObjectRegistry to hold user objects in memory 
 between tasks. | 
ByteBuffer | 
getServiceConsumerMetaData(String serviceName)
Returns meta-data for the specified service. 
 | 
ByteBuffer | 
getServiceProviderMetaData(String serviceName)
Return Provider meta-data for the specified service As an example, when the
 MR ShuffleHandler is used - this would return the shuffle port serialized
 as bytes 
 | 
int | 
getTaskAttemptNumber()
Get the current Task Attempt Number 
 | 
int | 
getTaskIndex()
Get the index of this Task among the tasks of this vertex 
 | 
int | 
getTaskVertexIndex()
Get the index of this task's vertex in the set of vertices in the DAG. 
 | 
String | 
getTaskVertexName()
Get the name of the Vertex in which the task is running 
 | 
long | 
getTotalMemoryAvailableToTask()
Gets the total memory available to all components of the running task. 
 | 
String | 
getUniqueIdentifier()
Returns an identifier which is unique to the specific Input, Processor or
 Output 
 | 
UserPayload | 
getUserPayload()
Get the User Payload for the Input/Output/Processor 
 | 
int | 
getVertexParallelism()
Get the vertex parallelism of the vertex to which this task belongs. 
 | 
String[] | 
getWorkDirs()
Get the work directories for the Input/Output/Processor 
 | 
void | 
requestInitialMemory(long size,
                    MemoryUpdateCallback callbackHandler)
Request a specific amount of memory during initialization
 (initialize(..*Context)) The requester is notified of allocation via the
 provided callback handler. 
 | 
void | 
sendEvents(List<Event> events)
Send Events to the AM and/or dependent Vertices 
 | 
org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
ApplicationId for the running appApplicationIdint getDAGAttemptNumber()
int getTaskIndex()
int getTaskAttemptNumber()
String getDAGName()
String getTaskVertexName()
int getTaskVertexIndex()
int getDagIdentifier()
TezCounters getCounters()
void sendEvents(List<Event> events)
events - Events to be sentUserPayload getUserPayload()
String[] getWorkDirs()
String getUniqueIdentifier()
ObjectRegistry getObjectRegistry()
ObjectRegistry to hold user objects in memory 
 between tasks.ObjectRegistryvoid fatalError(@Nullable Throwable exception, @Nullable String message)
exception - an exception representing the errorByteBuffer getServiceConsumerMetaData(String serviceName)
serviceName - the name of the service for which meta-data is required@Nullable ByteBuffer getServiceProviderMetaData(String serviceName)
serviceName - the name of the service for which provider meta-data is requiredvoid requestInitialMemory(long size,
                        MemoryUpdateCallback callbackHandler)
size - request size in bytes.callbackHandler - the callback handler to be invoked once memory is assignedlong getTotalMemoryAvailableToTask()
int getVertexParallelism()
ExecutionContext getExecutionContext()
Copyright © 2015 Apache Software Foundation. All rights reserved.