@InterfaceAudience.Public
public interface TaskContext
Modifier and Type | Method and Description |
---|---|
void |
fatalError(Throwable exception,
String message)
Deprecated.
Replaced by
reportFailure(TaskFailureType, Throwable, String) (FailureType, Throwable, String)}
Note: To maintain compatibility, even though this method is named 'fatalError' - this method
operates as reportFailure(TaskFailureType, Throwable, String)
with the TaskFailureType set to TaskFailureType.NON_FATAL . |
org.apache.hadoop.yarn.api.records.ApplicationId |
getApplicationId()
Get the
ApplicationId for the running app |
org.apache.hadoop.conf.Configuration |
getContainerConfiguration()
Get container configuration
|
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 |
notifyProgress()
Notifies the framework that progress is being made by this component.
|
void |
reportFailure(org.apache.tez.runtime.api.TaskFailureType taskFailureType,
Throwable exception,
String message)
Report an error to the framework.
|
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 appApplicationId
int getDAGAttemptNumber()
int getTaskIndex()
int getTaskAttemptNumber()
org.apache.hadoop.conf.Configuration getContainerConfiguration()
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.ObjectRegistry
void notifyProgress()
@Deprecated void fatalError(@Nullable Throwable exception, @Nullable String message)
reportFailure(TaskFailureType, Throwable, String)
(FailureType, Throwable, String)}
Note: To maintain compatibility, even though this method is named 'fatalError' - this method
operates as reportFailure(TaskFailureType, Throwable, String)
with the TaskFailureType set to TaskFailureType.NON_FATAL
.exception
- an exception representing the errormessage
- a diagnostic message which may be associated with the errorvoid reportFailure(org.apache.tez.runtime.api.TaskFailureType taskFailureType, @Nullable Throwable exception, @Nullable String message)
taskFailureType
- the type of the errorexception
- any exception that may be associated with the errormessage
- a diagnostic message which may be associated with 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 © 2024 Apache Software Foundation. All rights reserved.