@InterfaceAudience.Public @InterfaceStability.Unstable public abstract class TaskScheduler extends Object implements org.apache.tez.common.ServicePluginLifecycle
TaskSchedulerContext
- which provides
a mechanism to notify the system about allocation decisions and resources to the Tez framework.Constructor and Description |
---|
TaskScheduler(TaskSchedulerContext taskSchedulerContext) |
Modifier and Type | Method and Description |
---|---|
abstract void |
allocateTask(Object task,
org.apache.hadoop.yarn.api.records.Resource capability,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.api.records.Priority priority,
Object containerSignature,
Object clientCookie)
A request to the source to allocate resources for a requesting task, based on a previously used
container
|
abstract void |
allocateTask(Object task,
org.apache.hadoop.yarn.api.records.Resource capability,
String[] hosts,
String[] racks,
org.apache.hadoop.yarn.api.records.Priority priority,
Object containerSignature,
Object clientCookie)
A request to the source to allocate resources for a requesting task, with location information
optionally specified
|
abstract void |
blacklistNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
Indication to a source that a node has been blacklisted, and should not be used for subsequent
allocations.
|
abstract void |
dagComplete()
Indicates to the scheduler that the currently running dag has completed.
|
abstract Object |
deallocateContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
A request to de-allocate a previously allocated container.
|
abstract boolean |
deallocateTask(Object task,
boolean taskSucceeded,
TaskAttemptEndReason endReason,
String diagnostics)
A request to deallocate a task.
|
abstract org.apache.hadoop.yarn.api.records.Resource |
getAvailableResources()
Get the currently available resources from this source
|
abstract int |
getClusterNodeCount()
Get the number of nodes available from the source
|
TaskSchedulerContext |
getContext()
Get the
TaskSchedulerContext associated with this instance of the scheduler, which is
used to communicate with the rest of the system |
abstract org.apache.hadoop.yarn.api.records.Resource |
getTotalResources()
Get the total available resources from this source
|
abstract boolean |
hasUnregistered()
Checks with the scheduler whether it has unregistered.
|
void |
initialize()
An entry point for initialization.
|
void |
initiateStop()
The first step of stopping the task scheduler service.
|
abstract void |
setShouldUnregister()
Inform the scheduler that it should unregister.
|
void |
shutdown()
Stop the service.
|
void |
start()
An entry point for starting the service.
|
abstract void |
unblacklistNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
Indication to a source that a node has been un-blacklisted, and can be used from subsequent
allocations
|
public TaskScheduler(TaskSchedulerContext taskSchedulerContext)
public void initialize() throws Exception
initialize
in interface org.apache.tez.common.ServicePluginLifecycle
Exception
public void start() throws Exception
start
in interface org.apache.tez.common.ServicePluginLifecycle
Exception
public void shutdown() throws Exception
shutdown
in interface org.apache.tez.common.ServicePluginLifecycle
Exception
public void initiateStop()
public final TaskSchedulerContext getContext()
TaskSchedulerContext
associated with this instance of the scheduler, which is
used to communicate with the rest of the systemTaskSchedulerContext
public abstract org.apache.hadoop.yarn.api.records.Resource getAvailableResources()
public abstract org.apache.hadoop.yarn.api.records.Resource getTotalResources()
public abstract int getClusterNodeCount()
public abstract void blacklistNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
nodeId
- te nodeId to be blacklistedpublic abstract void unblacklistNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
nodeId
- the nodeId to be unblacklistedpublic abstract void allocateTask(Object task, org.apache.hadoop.yarn.api.records.Resource capability, String[] hosts, String[] racks, org.apache.hadoop.yarn.api.records.Priority priority, Object containerSignature, Object clientCookie)
task
- the task for which resources are being accepted.capability
- the required resources to run this taskhosts
- the preferred host locations for the taskracks
- the preferred rack locations for the taskpriority
- the priority of the request for this allocation. A lower value
implies a higher prioritycontainerSignature
- the specifications for the container (environment, etc) which will
be
used for this task - if applicableclientCookie
- a cookie associated with this request. This should be returned back
via the TaskSchedulerContext.taskAllocated(Object, Object,
Container)
method when a task is assigned to a resourcepublic abstract void allocateTask(Object task, org.apache.hadoop.yarn.api.records.Resource capability, org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Priority priority, Object containerSignature, Object clientCookie)
task
- the task for which resources are being accepted.capability
- the required resources to run this taskcontainerId
- a previous container which is used as an indication as to where this
task should be placedpriority
- the priority of the request for this allocation. A lower value
implies a higher prioritycontainerSignature
- the specifications for the container (environment, etc) which will
be
used for this task - if applicableclientCookie
- a cookie associated with this request. This should be returned back
via the TaskSchedulerContext.taskAllocated(Object, Object,
Container)
method when a task is assigned to a resourcepublic abstract boolean deallocateTask(Object task, boolean taskSucceeded, TaskAttemptEndReason endReason, @Nullable String diagnostics)
task
- the task being de-allocated.taskSucceeded
- whether the task succeeded or notendReason
- the reason for the task failurediagnostics
- additional diagnostics information which may be relevantpublic abstract Object deallocateContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId
- the containerId to de-allocatepublic abstract void setShouldUnregister()
public abstract boolean hasUnregistered()
public abstract void dagComplete()
Copyright © 2015 Apache Software Foundation. All rights reserved.