@InterfaceAudience.LimitedPrivate(value="yarn") @InterfaceStability.Unstable public class FairScheduler extends AbstractYarnScheduler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
assignMultiple |
static org.apache.hadoop.yarn.api.records.Resource |
CONTAINER_RESERVED |
protected boolean |
continuousSchedulingEnabled |
protected int |
continuousSchedulingSleepMs |
protected long |
lastPreemptionUpdateTime |
protected int |
maxAssign |
protected long |
nodeLocalityDelayMs |
protected double |
nodeLocalityThreshold |
protected boolean |
preemptionEnabled |
protected long |
preemptionInterval |
protected long |
rackLocalityDelayMs |
protected double |
rackLocalityThreshold |
protected boolean |
sizeBasedWeight |
protected long |
UPDATE_INTERVAL |
protected long |
waitTimeBeforeKill |
protected WeightAdjuster |
weightAdjuster |
applications, EMPTY_ALLOCATION, EMPTY_CONTAINER_LIST, rmContext| Constructor and Description |
|---|
FairScheduler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String queueName,
String user)
Add a new application to the scheduler, with a given id, queue name, and
user.
|
protected void |
addApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
boolean transferStateFromPreviousAttempt)
Add a new application attempt to the scheduler.
|
Allocation |
allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask,
List<org.apache.hadoop.yarn.api.records.ContainerId> release,
List<String> blacklistAdditions,
List<String> blacklistRemovals)
The main api between the ApplicationMaster and the Scheduler.
|
boolean |
checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI,
org.apache.hadoop.yarn.api.records.QueueACL acl,
String queueName)
Check if the user has permission to perform the operation.
|
AllocationConfiguration |
getAllocationConfiguration() |
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.
|
List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> |
getAppsInQueue(String queueName)
Gets the apps under a given queue
|
ResourceWeights |
getAppWeight(AppSchedulable app) |
org.apache.hadoop.yarn.util.Clock |
getClock() |
org.apache.hadoop.yarn.api.records.Resource |
getClusterCapacity() |
FairSchedulerConfiguration |
getConf() |
RMContainerTokenSecretManager |
getContainerTokenSecretManager() |
int |
getContinuousSchedulingSleepMs() |
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerEventLog |
getEventLog() |
org.apache.hadoop.yarn.api.records.Resource |
getIncrementResourceCapability() |
org.apache.hadoop.yarn.api.records.Resource |
getMaximumResourceCapability()
Get maximum allocatable
Resource. |
org.apache.hadoop.yarn.api.records.Resource |
getMinimumResourceCapability()
Get minimum allocatable
Resource. |
long |
getNodeLocalityDelayMs() |
double |
getNodeLocalityThreshold() |
SchedulerNodeReport |
getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
Get node resource usage report.
|
int |
getNumClusterNodes()
Get the number of nodes available in the cluster.
|
org.apache.hadoop.yarn.api.records.QueueInfo |
getQueueInfo(String queueName,
boolean includeChildQueues,
boolean recursive)
Get queue information
|
QueueManager |
getQueueManager() |
List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> |
getQueueUserAclInfo()
Get acls for queues for current user.
|
long |
getRackLocalityDelayMs() |
double |
getRackLocalityThreshold() |
RMContainer |
getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Get the container for the given containerId.
|
QueueMetrics |
getRootQueueMetrics()
Get the root queue for the scheduler.
|
FSSchedulerApp |
getSchedulerApp(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) |
SchedulerAppReport |
getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
Get the Scheduler app for a given app attempt Id.
|
void |
handle(SchedulerEvent event) |
boolean |
isContinuousSchedulingEnabled() |
String |
moveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
String queueName)
Moves the given application to the given queue
|
protected void |
preemptResources(Collection<FSLeafQueue> scheds,
HashMap<AppSchedulable,org.apache.hadoop.yarn.api.records.Resource> toPreempt)
Preempt a quantity of resources from a list of QueueSchedulables.
|
protected void |
preemptTasksIfNecessary()
Check for queues that need tasks preempted, either because they have been
below their guaranteed share for minSharePreemptionTimeout or they have
been below half their fair share for the fairSharePreemptionTimeout.
|
void |
recover(RMStateStore.RMState state) |
void |
reinitialize(org.apache.hadoop.conf.Configuration conf,
RMContext rmContext)
Re-initialize the
ResourceScheduler. |
protected HashMap<AppSchedulable,org.apache.hadoop.yarn.api.records.Resource> |
resToPreempt(FSLeafQueue sched,
long curTime)
Return the resource amount that this queue is allowed to preempt, if any.
|
protected void |
setClock(org.apache.hadoop.yarn.util.Clock clock) |
protected void |
update()
Recompute the internal variables used by the scheduler - per-job weights,
fair shares, deficits, minimum slot allocations, and amount of used and
required resources per job.
|
getSchedulerApplications, getTransferredContainerspublic static final org.apache.hadoop.yarn.api.records.Resource CONTAINER_RESERVED
protected long UPDATE_INTERVAL
protected long lastPreemptionUpdateTime
protected long preemptionInterval
protected long waitTimeBeforeKill
protected boolean preemptionEnabled
protected boolean sizeBasedWeight
protected WeightAdjuster weightAdjuster
protected boolean continuousSchedulingEnabled
protected int continuousSchedulingSleepMs
protected double nodeLocalityThreshold
protected double rackLocalityThreshold
protected long nodeLocalityDelayMs
protected long rackLocalityDelayMs
protected boolean assignMultiple
protected int maxAssign
public FairSchedulerConfiguration getConf()
public QueueManager getQueueManager()
public RMContainer getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
YarnSchedulerprotected void update()
protected void preemptTasksIfNecessary()
protected void preemptResources(Collection<FSLeafQueue> scheds, HashMap<AppSchedulable,org.apache.hadoop.yarn.api.records.Resource> toPreempt)
protected HashMap<AppSchedulable,org.apache.hadoop.yarn.api.records.Resource> resToPreempt(FSLeafQueue sched, long curTime)
public RMContainerTokenSecretManager getContainerTokenSecretManager()
public ResourceWeights getAppWeight(AppSchedulable app)
public org.apache.hadoop.yarn.api.records.Resource getMinimumResourceCapability()
YarnSchedulerResource.public org.apache.hadoop.yarn.api.records.Resource getIncrementResourceCapability()
public org.apache.hadoop.yarn.api.records.Resource getMaximumResourceCapability()
YarnSchedulerResource.public double getNodeLocalityThreshold()
public double getRackLocalityThreshold()
public long getNodeLocalityDelayMs()
public long getRackLocalityDelayMs()
public boolean isContinuousSchedulingEnabled()
public int getContinuousSchedulingSleepMs()
public org.apache.hadoop.yarn.api.records.Resource getClusterCapacity()
public org.apache.hadoop.yarn.util.Clock getClock()
protected void setClock(org.apache.hadoop.yarn.util.Clock clock)
public org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerEventLog getEventLog()
protected void addApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String queueName,
String user)
protected void addApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
boolean transferStateFromPreviousAttempt)
public Allocation allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask, List<org.apache.hadoop.yarn.api.records.ContainerId> release, List<String> blacklistAdditions, List<String> blacklistRemovals)
YarnSchedulerAllocation for the applicationpublic SchedulerNodeReport getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
YarnSchedulerSchedulerNodeReport for the node or null
if nodeId does not point to a defined node.public FSSchedulerApp getSchedulerApp(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
public SchedulerAppReport getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
YarnSchedulerappAttemptId - the id of the application attemptpublic org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
YarnSchedulerappAttemptId - the id of the application attemptpublic QueueMetrics getRootQueueMetrics()
YarnSchedulerpublic void handle(SchedulerEvent event)
public void recover(RMStateStore.RMState state) throws Exception
Exceptionpublic void reinitialize(org.apache.hadoop.conf.Configuration conf,
RMContext rmContext)
throws IOException
ResourceSchedulerResourceScheduler.conf - configurationIOExceptionpublic org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(String queueName, boolean includeChildQueues, boolean recursive) throws IOException
YarnSchedulerqueueName - queue nameincludeChildQueues - include child queues?recursive - get children queues?IOExceptionpublic List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo()
YarnSchedulerpublic int getNumClusterNodes()
YarnSchedulerpublic boolean checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI,
org.apache.hadoop.yarn.api.records.QueueACL acl,
String queueName)
YarnSchedulerQueueACL.ADMINISTER_QUEUE permission,
this user can view/modify the applications in this queuetrue if the user has the permission,
false otherwisepublic AllocationConfiguration getAllocationConfiguration()
public List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> getAppsInQueue(String queueName)
YarnSchedulerqueueName - the name of the queue.public String moveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId, String queueName) throws org.apache.hadoop.yarn.exceptions.YarnException
YarnSchedulermoveApplication in interface YarnSchedulermoveApplication in class AbstractYarnSchedulerorg.apache.hadoop.yarn.exceptions.YarnException - if the move cannot be carried outCopyright © 2014 Apache Software Foundation. All Rights Reserved.