@InterfaceAudience.Private public class TezTaskCommunicatorImpl extends TaskCommunicator
| Modifier and Type | Class and Description |
|---|---|
static class |
TezTaskCommunicatorImpl.ContainerInfo |
| Modifier and Type | Field and Description |
|---|---|
protected InetSocketAddress |
address |
protected ConcurrentMap<org.apache.tez.dag.records.TezTaskAttemptID,org.apache.hadoop.yarn.api.records.ContainerId> |
attemptToContainerMap |
protected org.apache.hadoop.conf.Configuration |
conf |
protected ConcurrentMap<org.apache.hadoop.yarn.api.records.ContainerId,TezTaskCommunicatorImpl.ContainerInfo> |
registeredContainers |
protected org.apache.hadoop.ipc.Server |
server |
protected org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> |
sessionToken |
protected String |
tokenIdentifier |
| Constructor and Description |
|---|
TezTaskCommunicatorImpl(TaskCommunicatorContext taskCommunicatorContext)
Construct the service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dagComplete(int dagIdentifier)
Indicates the current running dag is complete.
|
InetSocketAddress |
getAddress()
Return the address, if any, that the service listens on
|
protected org.apache.hadoop.conf.Configuration |
getConf() |
protected org.apache.hadoop.yarn.api.records.ContainerId |
getContainerForAttempt(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId) |
protected TezTaskCommunicatorImpl.ContainerInfo |
getContainerInfo(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
Object |
getMetaInfo()
Share meta-information such as host:port information where the Task Communicator may be
listening.
|
protected org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> |
getSessionToken() |
protected String |
getTokenIdentifier() |
org.apache.tez.common.TezTaskUmbilicalProtocol |
getUmbilical() |
void |
onVertexStateUpdated(org.apache.tez.dag.api.event.VertexStateUpdate stateUpdate)
Receive notifications on vertex state changes.
|
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.
|
void |
registerRunningContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String host,
int port)
Register a new container.
|
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.
|
protected void |
startRpcServer() |
protected void |
stopRpcServer() |
void |
unregisterRunningTaskAttempt(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptID,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason endReason,
String diagnostics)
Register the completion of a task.
|
getCompletedLogsUrl, getContext, getInProgressLogsUrl, initializeprotected final ConcurrentMap<org.apache.hadoop.yarn.api.records.ContainerId,TezTaskCommunicatorImpl.ContainerInfo> registeredContainers
protected final ConcurrentMap<org.apache.tez.dag.records.TezTaskAttemptID,org.apache.hadoop.yarn.api.records.ContainerId> attemptToContainerMap
protected final String tokenIdentifier
protected final org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> sessionToken
protected final org.apache.hadoop.conf.Configuration conf
protected InetSocketAddress address
protected volatile org.apache.hadoop.ipc.Server server
public TezTaskCommunicatorImpl(TaskCommunicatorContext taskCommunicatorContext)
public void start()
TaskCommunicatorstart in interface org.apache.tez.common.ServicePluginLifecyclestart in class TaskCommunicatorpublic void shutdown()
TaskCommunicatorshutdown in interface org.apache.tez.common.ServicePluginLifecycleshutdown in class TaskCommunicatorprotected void startRpcServer()
protected void stopRpcServer()
protected org.apache.hadoop.conf.Configuration getConf()
public void registerRunningContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String host,
int port)
TaskCommunicatorregisterRunningContainer in class TaskCommunicatorcontainerId - the associated containerIdhost - the hostname on which the container runsport - the port for the service which is running the containerpublic void registerContainerEnd(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.tez.serviceplugins.api.ContainerEndReason endReason,
String diagnostics)
TaskCommunicatorregisterContainerEnd in class TaskCommunicatorcontainerId - the associated containerIdendReason - the end reason for the container completingdiagnostics - diagnostics associated with the container endpublic 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)
TaskCommunicatorregisterRunningTaskAttempt in class TaskCommunicatorcontainerId - 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 executedpublic void unregisterRunningTaskAttempt(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptID,
org.apache.tez.serviceplugins.api.TaskAttemptEndReason endReason,
String diagnostics)
TaskCommunicatorunregisterRunningTaskAttempt in class TaskCommunicatortaskAttemptID - the task attempt which has completed / needs to be completedendReason - the endReason for the task attempt.diagnostics - diagnostics associated with the task endpublic InetSocketAddress getAddress()
TaskCommunicatorgetAddress in class TaskCommunicatorpublic void onVertexStateUpdated(org.apache.tez.dag.api.event.VertexStateUpdate stateUpdate)
TaskCommunicatorInputInitializerContext.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.
onVertexStateUpdated in class TaskCommunicatorstateUpdate - 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 VertexStateUpdatepublic void dagComplete(int dagIdentifier)
TaskCommunicatordagComplete in class TaskCommunicatordagIdentifier - the unique numerical identifier for the DAG in the specified execution context.public Object getMetaInfo()
TaskCommunicatorgetMetaInfo in class TaskCommunicatorprotected String getTokenIdentifier()
protected org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> getSessionToken()
public org.apache.tez.common.TezTaskUmbilicalProtocol getUmbilical()
protected TezTaskCommunicatorImpl.ContainerInfo getContainerInfo(org.apache.hadoop.yarn.api.records.ContainerId containerId)
protected org.apache.hadoop.yarn.api.records.ContainerId getContainerForAttempt(org.apache.tez.dag.records.TezTaskAttemptID taskAttemptId)
Copyright © 2020 Apache Software Foundation. All rights reserved.