@InterfaceAudience.Public
@InterfaceStability.Unstable
public interface TaskSchedulerContext
extends org.apache.tez.serviceplugins.api.ServicePluginContextBase
TaskScheduler
This provides methods for a scheduler to interact with the Tez framework.
Calls into this should be outside of locks, which may also be obtained by methods in the
scheduler
which implement the TaskScheduler interface| Modifier and Type | Method and Description |
|---|---|
void |
appShutdownRequested()
Inform the framework that an app shutdown is required.
|
void |
containerAllocated(org.apache.hadoop.yarn.api.records.Container container)
Indicate to the framework that a container is being allocated.
|
void |
containerBeingReleased(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Indicates to the framework that a container is being released.
|
void |
containerCompleted(Object taskLastAllocated,
org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus)
Indicate to the framework that a container has completed.
|
void |
containerReused(org.apache.hadoop.yarn.api.records.Container container)
Indicate to the framework that a container is being reused:
there is a task assigned to an already used container.
|
org.apache.tez.serviceplugins.api.TaskSchedulerContext.AMState |
getAMState()
Get the state of the AppMaster
|
int |
getAppClientPort()
Get the port on which the DAG client is listening
|
String |
getAppHostName()
Get the hostname on which the app is running
|
org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
getApplicationAttemptId()
Get the application attempt id for the running application.
|
String |
getAppTrackingUrl()
Get the tracking URL for the application.
|
ContainerSignatureMatcher |
getContainerSignatureMatcher()
Get an instance of
ContainerSignatureMatcher which can be used to check whether the
specifications of a container match what is required by a task. |
long |
getCustomClusterIdentifier()
A custom cluster identifier allocated to schedulers to generate an AppId, if not making
use of YARN
|
org.apache.tez.serviceplugins.api.TaskSchedulerContext.AppFinalStatus |
getFinalAppStatus()
Get the final status for the application, which could be provided to the coordinator of the
source.
|
float |
getProgress()
Request the framework for progress of the running DAG.
|
int |
getVertexIndexForTask(Object task) |
boolean |
isSession()
Check whether the AM is running in session mode.
|
void |
nodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> updatedNodes)
Provide an update to the framework about the status of nodes available to this report
|
void |
preemptContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Inform the framework that the scheduler has determined that a previously allocated container
needs to be preempted
|
void |
setApplicationRegistrationData(org.apache.hadoop.yarn.api.records.Resource maxContainerCapability,
Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> appAcls,
ByteBuffer clientAMSecretKey,
String queueName)
Provide an update to the framework about specific information about the source managed by this
scheduler.
|
void |
taskAllocated(Object task,
Object appCookie,
org.apache.hadoop.yarn.api.records.Container container)
Indicate to the framework that a container is being assigned to a task.
|
void taskAllocated(Object task, Object appCookie, org.apache.hadoop.yarn.api.records.Container container)
task - the task for which a container is being assigned. This should be the same
instance that was provided when requesting for an allocationappCookie - the cookie which was provided while requesting allocation for this taskcontainer - the actual container assigned to the taskvoid containerAllocated(org.apache.hadoop.yarn.api.records.Container container)
container - the actual containervoid containerReused(org.apache.hadoop.yarn.api.records.Container container)
container - the actual containervoid containerCompleted(Object taskLastAllocated, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus)
taskLastAllocated - the task that was allocated to this container, if any. This is the
same instance that was passed in while requesting an allocationcontainerStatus - the status with which the container endedvoid containerBeingReleased(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - the id of the container being releasedvoid nodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> updatedNodes)
updatedNodes - a list of updated node reportsvoid appShutdownRequested()
void setApplicationRegistrationData(org.apache.hadoop.yarn.api.records.Resource maxContainerCapability,
Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> appAcls,
ByteBuffer clientAMSecretKey,
String queueName)
maxContainerCapability - the total resource capability of the sourceappAcls - ACLs for the sourceclientAMSecretKey - a secret key provided by the sourcevoid preemptContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - the containerId to be preemptedorg.apache.tez.serviceplugins.api.TaskSchedulerContext.AppFinalStatus getFinalAppStatus()
String getAppTrackingUrl()
float getProgress()
long getCustomClusterIdentifier()
ContainerSignatureMatcher getContainerSignatureMatcher()
ContainerSignatureMatcher which can be used to check whether the
specifications of a container match what is required by a task.ContainerSignatureMatcherorg.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()
String getAppHostName()
int getAppClientPort()
boolean isSession()
org.apache.tez.serviceplugins.api.TaskSchedulerContext.AMState getAMState()
int getVertexIndexForTask(Object task)
Copyright © 2024 Apache Software Foundation. All rights reserved.