public abstract class AbstractYarnScheduler<T extends SchedulerApplicationAttempt,N extends SchedulerNode> extends org.apache.hadoop.service.AbstractService implements ResourceScheduler
| Modifier and Type | Field and Description |
|---|---|
protected Map<org.apache.hadoop.yarn.api.records.ApplicationId,SchedulerApplication<T>> |
applications |
protected org.apache.hadoop.yarn.api.records.Resource |
clusterResource |
protected static Allocation |
EMPTY_ALLOCATION |
protected static List<org.apache.hadoop.yarn.api.records.Container> |
EMPTY_CONTAINER_LIST |
protected org.apache.hadoop.yarn.api.records.Resource |
maximumAllocation |
protected org.apache.hadoop.yarn.api.records.Resource |
minimumAllocation |
protected Map<org.apache.hadoop.yarn.api.records.NodeId,N> |
nodes |
protected RMContext |
rmContext |
| Constructor and Description |
|---|
AbstractYarnScheduler(String name)
Construct the service.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) |
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport |
getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
Get a resource usage report from a given app attempt ID.
|
org.apache.hadoop.yarn.api.records.Resource |
getClusterResource()
Get the whole resource capacity of the cluster.
|
T |
getCurrentAttemptForContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
org.apache.hadoop.yarn.api.records.Resource |
getMaximumResourceCapability()
Get maximum allocatable
Resource. |
org.apache.hadoop.yarn.api.records.Resource |
getMinimumResourceCapability()
Get minimum allocatable
Resource. |
SchedulerNodeReport |
getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
Get node resource usage report.
|
RMContainer |
getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Get the container for the given containerId.
|
SchedulerAppReport |
getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
Get the Scheduler app for a given app attempt Id.
|
Map<org.apache.hadoop.yarn.api.records.ApplicationId,SchedulerApplication<T>> |
getSchedulerApplications() |
SchedulerNode |
getSchedulerNode(org.apache.hadoop.yarn.api.records.NodeId nodeId) |
List<org.apache.hadoop.yarn.api.records.Container> |
getTransferredContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId currentAttempt) |
String |
moveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
String newQueue)
Moves the given application to the given queue
|
void |
recoverContainersOnNode(List<org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus> containerReports,
RMNode nm) |
protected void |
recoverResourceRequestForContainer(RMContainer rmContainer)
Recover resource request back from RMContainer when a container is
preempted before AM pulled the same.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreinitialize, setRMContextallocate, checkAccess, getAppsInQueue, getNumClusterNodes, getQueueInfo, getQueueUserAclInfo, getRootQueueMetricsrecoverprotected Map<org.apache.hadoop.yarn.api.records.NodeId,N extends SchedulerNode> nodes
protected org.apache.hadoop.yarn.api.records.Resource clusterResource
protected org.apache.hadoop.yarn.api.records.Resource minimumAllocation
protected org.apache.hadoop.yarn.api.records.Resource maximumAllocation
protected RMContext rmContext
protected Map<org.apache.hadoop.yarn.api.records.ApplicationId,SchedulerApplication<T extends SchedulerApplicationAttempt>> applications
protected static final List<org.apache.hadoop.yarn.api.records.Container> EMPTY_CONTAINER_LIST
protected static final Allocation EMPTY_ALLOCATION
public AbstractYarnScheduler(String name)
name - service namepublic List<org.apache.hadoop.yarn.api.records.Container> getTransferredContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId currentAttempt)
public Map<org.apache.hadoop.yarn.api.records.ApplicationId,SchedulerApplication<T>> getSchedulerApplications()
public org.apache.hadoop.yarn.api.records.Resource getClusterResource()
YarnSchedulergetClusterResource in interface YarnSchedulerpublic org.apache.hadoop.yarn.api.records.Resource getMinimumResourceCapability()
YarnSchedulerResource.getMinimumResourceCapability in interface YarnSchedulerpublic org.apache.hadoop.yarn.api.records.Resource getMaximumResourceCapability()
YarnSchedulerResource.getMaximumResourceCapability in interface YarnSchedulerpublic T getApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
public SchedulerAppReport getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
YarnSchedulergetSchedulerAppInfo in interface YarnSchedulerappAttemptId - the id of the application attemptpublic org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
YarnSchedulergetAppResourceUsageReport in interface YarnSchedulerappAttemptId - the id of the application attemptpublic T getCurrentAttemptForContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
public RMContainer getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
YarnSchedulergetRMContainer in interface YarnSchedulerpublic SchedulerNodeReport getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
YarnSchedulergetNodeReport in interface YarnSchedulerSchedulerNodeReport for the node or null
if nodeId does not point to a defined node.public String moveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId, String newQueue) throws org.apache.hadoop.yarn.exceptions.YarnException
YarnSchedulermoveApplication in interface YarnSchedulerorg.apache.hadoop.yarn.exceptions.YarnException - if the move cannot be carried outpublic void recoverContainersOnNode(List<org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus> containerReports, RMNode nm)
protected void recoverResourceRequestForContainer(RMContainer rmContainer)
rmContainer - public SchedulerNode getSchedulerNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.