public interface TaskCommunicatorContext
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCommit(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId)
Check whether a running attempt can commit.
|
void |
containerAlive(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Inform the framework that a container is alive.
|
org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
getApplicationAttemptId()
Get the application attempt id for the running application.
|
org.apache.hadoop.security.Credentials |
getCredentials()
Get credentials associated with the AppMaster
|
String |
getCurrentAppIdentifier()
Get an identifier for the executing context of the DAG.
|
int |
getCurrentDagIdenitifer()
Get the identifier for the currently executing dag.
|
String |
getCurrentDagName()
Get the name of the currently executing dag
|
long |
getDagStartTime()
Get the start time for the currently executing DAG
|
long |
getFirstAttemptStartTime(String vertexName,
int taskIndex)
Get the start time for the first attempt of the specified task
|
org.apache.tez.dag.api.UserPayload |
getInitialUserPayload()
Get the UserPayload that was configured while setting up the task communicator
|
Iterable<String> |
getInputVertexNames(String vertexName)
Get the name of the Input vertices for the specified vertex.
|
int |
getVertexCompletedTaskCount(String vertexName)
Get the number of completed tasks for a given vertex
|
int |
getVertexRunningTaskCount(String vertexName)
Get the number of running tasks for a given vertex
|
int |
getVertexTotalTaskCount(String vertexName)
Get the total number of tasks in the given vertex
|
TaskHeartbeatResponse |
heartbeat(TaskHeartbeatRequest request)
Mechanism for a
TaskCommunicator to provide updates on a running task, as well as
receive new information which may need to be propagated to the task. |
boolean |
isKnownContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Check whether the container is known by the framework.
|
void |
registerForVertexStateUpdates(String vertexName,
Set<org.apache.tez.dag.api.event.VertexState> stateSet)
Register to get notifications on updates to the specified vertex.
|
void |
taskAlive(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId)
Inform the framework that a task is alive.
|
void |
taskFailed(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason taskAttemptEndReason,
String diagnostics)
Inform the framework that a task has failed
|
void |
taskKilled(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason taskAttemptEndReason,
String diagnostics)
Inform the framework that a task has been killed
|
void |
taskStartedRemotely(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId)
Inform the framework that the task has started execution
|
org.apache.tez.dag.api.UserPayload getInitialUserPayload()
org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()
org.apache.hadoop.security.Credentials getCredentials()
boolean canCommit(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId)
throws IOException
taskAttemptId - the associated task attempt idIOExceptionTaskHeartbeatResponse heartbeat(TaskHeartbeatRequest request) throws IOException, org.apache.tez.dag.api.TezException
TaskCommunicator to provide updates on a running task, as well as
receive new information which may need to be propagated to the task. This includes events
generated by the task and events which need to be sent to the task
This method must be invoked periodically to receive updates for a running taskrequest - the update from the running task.IOExceptionorg.apache.tez.dag.api.TezExceptionboolean isKnownContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - the relevant container idvoid taskAlive(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId)
taskAttemptId - the relevant task attemptvoid containerAlive(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - the relevant container idvoid taskStartedRemotely(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId)
taskAttemptId - the relevant task attempt idcontainerId - the containerId in which the task attempt is runningvoid taskKilled(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason taskAttemptEndReason,
@Nullable
String diagnostics)
taskAttemptId - the relevant task attempt idtaskAttemptEndReason - the reason for the task attempt being killeddiagnostics - any diagnostics messages which are relevant to the task attempt
killvoid taskFailed(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason taskAttemptEndReason,
@Nullable
String diagnostics)
taskAttemptId - the relevant task attempt idtaskAttemptEndReason - the reason for the task failurediagnostics - any diagnostics messages which are relevant to the task attempt
failurevoid registerForVertexStateUpdates(String vertexName, @Nullable Set<org.apache.tez.dag.api.event.VertexState> stateSet)
InputInitializer.onVertexStateUpdated(org.apache.tez.dag.api.event.VertexStateUpdate)
This method can only be invoked once. Duplicate invocations will result in an error.vertexName - the vertex name for which notifications are required.stateSet - the set of states for which notifications are required. null implies allString getCurrentDagName()
String getCurrentAppIdentifier()
int getCurrentDagIdenitifer()
Iterable<String> getInputVertexNames(String vertexName)
vertexName - the vertex for which source vertex names will be returnedint getVertexTotalTaskCount(String vertexName)
vertexName - the relevant vertex nameint getVertexCompletedTaskCount(String vertexName)
vertexName - the vertex nameint getVertexRunningTaskCount(String vertexName)
vertexName - the vertex namelong getFirstAttemptStartTime(String vertexName, int taskIndex)
vertexName - the vertex to which the task belongstaskIndex - the index of the tasklong getDagStartTime()
Copyright © 2016 Apache Software Foundation. All rights reserved.