public abstract class TaskCommunicator extends Object implements org.apache.tez.common.ServicePluginLifecycle
TaskCommunicatorContext - which provides
a mechanism to notify the system about allocation decisions and resources to the Tez framework.
If setting up a heartbeat between the task and the AM, the framework is responsible for error checking
of this heartbeat mechanism, handling lost or duplicate responses.| Constructor and Description |
|---|
TaskCommunicator(TaskCommunicatorContext taskCommunicatorContext) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
dagComplete(int dagIdentifier)
Indicates the current running dag is complete.
|
abstract InetSocketAddress |
getAddress()
Return the address, if any, that the service listens on
|
String |
getCompletedLogsUrl(org.apache.tez.dag.records.TezTaskAttemptID attemptID,
org.apache.hadoop.yarn.api.records.NodeId containerNodeId)
Return a URL that can be used as a link to the logs for a completed attempt.
|
TaskCommunicatorContext |
getContext()
Get the
TaskCommunicatorContext associated with this instance of the scheduler, which
is
used to communicate with the rest of the system |
String |
getInProgressLogsUrl(org.apache.tez.dag.records.TezTaskAttemptID attemptID,
org.apache.hadoop.yarn.api.records.NodeId containerNodeId)
Return a URL that can be used as a link to the logs for a running attempt.
|
abstract Object |
getMetaInfo()
Share meta-information such as host:port information where the Task Communicator may be
listening.
|
void |
initialize()
An entry point for initialization.
|
abstract void |
onVertexStateUpdated(org.apache.tez.dag.api.event.VertexStateUpdate stateUpdate)
Receive notifications on vertex state changes.
|
abstract void |
registerContainerEnd(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.tez.serviceplugins.api.ContainerEndReason endReason,
String diagnostics)
Register the end of a container.
|
abstract void |
registerRunningContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String hostname,
int port)
Register a new container.
|
abstract void |
registerRunningTaskAttempt(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.tez.runtime.api.impl.TaskSpec taskSpec,
Map<String,org.apache.hadoop.yarn.api.records.LocalResource> additionalResources,
org.apache.hadoop.security.Credentials credentials,
boolean credentialsChanged,
int priority)
Register a task attempt to execute on a container
|
void |
shutdown()
Stop the service.
|
void |
start()
An entry point for starting the service.
|
abstract void |
unregisterRunningTaskAttempt(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptID,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason endReason,
String diagnostics)
Register the completion of a task.
|
public TaskCommunicator(TaskCommunicatorContext taskCommunicatorContext)
public TaskCommunicatorContext getContext()
TaskCommunicatorContext associated with this instance of the scheduler, which
is
used to communicate with the rest of the systemTaskCommunicatorContextpublic void initialize()
throws Exception
initialize in interface org.apache.tez.common.ServicePluginLifecycleExceptionpublic void start()
throws Exception
start in interface org.apache.tez.common.ServicePluginLifecycleExceptionpublic void shutdown()
throws Exception
shutdown in interface org.apache.tez.common.ServicePluginLifecycleExceptionpublic abstract void registerRunningContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String hostname,
int port)
throws org.apache.tez.serviceplugins.api.ServicePluginException
containerId - the associated containerIdhostname - the hostname on which the container runsport - the port for the service which is running the containerServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract void registerContainerEnd(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.tez.serviceplugins.api.ContainerEndReason endReason,
@Nullable
String diagnostics)
throws org.apache.tez.serviceplugins.api.ServicePluginException
containerId - the associated containerIdendReason - the end reason for the container completingdiagnostics - diagnostics associated with the container endServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract void registerRunningTaskAttempt(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.tez.runtime.api.impl.TaskSpec taskSpec,
Map<String,org.apache.hadoop.yarn.api.records.LocalResource> additionalResources,
org.apache.hadoop.security.Credentials credentials,
boolean credentialsChanged,
int priority)
throws org.apache.tez.serviceplugins.api.ServicePluginException
containerId - the containerId on which this task needs to runtaskSpec - the task specifications for the task to be executedadditionalResources - additional local resources which may be required to run this task
on
the containercredentials - the credentials required to run this taskcredentialsChanged - whether the credentials are different from the original credentials
associated with this containerpriority - the priority of the task being executedServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract void unregisterRunningTaskAttempt(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptID,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason endReason,
@Nullable
String diagnostics)
throws org.apache.tez.serviceplugins.api.ServicePluginException
taskAttemptID - the task attempt which has completed / needs to be completedendReason - the endReason for the task attempt.diagnostics - diagnostics associated with the task endServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract InetSocketAddress getAddress() throws org.apache.tez.serviceplugins.api.ServicePluginException
ServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract void onVertexStateUpdated(org.apache.tez.dag.api.event.VertexStateUpdate stateUpdate)
throws org.apache.tez.serviceplugins.api.ServicePluginException
InputInitializerContext.registerForVertexStateUpdates(String,
java.util.Set). Notifications will be received for all registered state changes, and not just
for the latest state update. They will be in order in which the state change occurred.
Extensive processing should not be performed via this method call. Instead this should just be
used as a notification mechanism.
stateUpdate - an event indicating the name of the vertex, and it's updated state.
Additional information may be available for specific events, Look at the
type hierarchy for VertexStateUpdateServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract void dagComplete(int dagIdentifier)
throws org.apache.tez.serviceplugins.api.ServicePluginException
dagIdentifier - the unique numerical identifier for the DAG in the specified execution context.ServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public abstract Object getMetaInfo() throws org.apache.tez.serviceplugins.api.ServicePluginException
ServicePluginException - when the service runs into a fatal error which it cannot handle.
This will cause the app to shutdown.public String getInProgressLogsUrl(org.apache.tez.dag.records.TezTaskAttemptID attemptID, org.apache.hadoop.yarn.api.records.NodeId containerNodeId)
attemptID - Attempt ID for which the log link should be providedcontainerNodeId - Node Id on which the attempt is meant to have runpublic String getCompletedLogsUrl(org.apache.tez.dag.records.TezTaskAttemptID attemptID, org.apache.hadoop.yarn.api.records.NodeId containerNodeId)
attemptID - Attempt ID for which the log link should be providedcontainerNodeId - Node Id on which the attempt is meant to have runCopyright © 2019 Apache Software Foundation. All rights reserved.