org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo
Class FifoScheduler

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler<FiCaSchedulerApp,FiCaSchedulerNode>
          extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler
All Implemented Interfaces:
Closeable, org.apache.hadoop.conf.Configurable, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>, Recoverable, ResourceScheduler, YarnScheduler

@InterfaceAudience.LimitedPrivate(value="yarn")
@InterfaceStability.Evolving
public class FifoScheduler
extends AbstractYarnScheduler<FiCaSchedulerApp,FiCaSchedulerNode>
implements org.apache.hadoop.conf.Configurable


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
 
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler
applications, clusterResource, EMPTY_ALLOCATION, EMPTY_CONTAINER_LIST, maximumAllocation, minimumAllocation, nmExpireInterval, nodes, rmContext
 
Constructor Summary
FifoScheduler()
           
 
Method Summary
 void addApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String queue, String user, boolean isAppRecovering)
           
 void addApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, boolean transferStateFromPreviousAttempt, boolean isAttemptRecovering)
           
 Allocation allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, 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.
protected  void completedContainer(RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event)
           
 List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> getAppsInQueue(String queueName)
          Gets the apps under a given queue
 org.apache.hadoop.conf.Configuration getConf()
           
 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
 List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo()
          Get acls for queues for current user.
 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.
 org.apache.hadoop.yarn.api.records.Resource getUsedResource()
           
 void handle(SchedulerEvent event)
           
 void recover(RMStateStore.RMState state)
           
 void reinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext)
          Re-initialize the ResourceScheduler.
 void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
 void serviceStart()
           
 void serviceStop()
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 void setRMContext(RMContext rmContext)
          Set RMContext for ResourceScheduler.
 
Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler
addQueue, containerLaunchedOnNode, createReleaseCache, getApplicationAttempt, getAppResourceUsageReport, getClusterResource, getCurrentAttemptForContainer, getMaximumResourceCapability, getMinimumResourceCapability, getNodeReport, getPlanQueues, getSchedulerAppInfo, getSchedulerApplications, getSchedulerNode, getSchedulingResourceTypes, getTransferredContainers, killAllAppsInQueue, moveAllApps, moveApplication, recoverContainersOnNode, recoverResourceRequestForContainer, releaseContainers, removeQueue, setEntitlement, updateNodeResource
 
Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FifoScheduler

public FifoScheduler()
Method Detail

serviceInit

public void serviceInit(org.apache.hadoop.conf.Configuration conf)
                 throws Exception
Overrides:
serviceInit in class AbstractYarnScheduler<FiCaSchedulerApp,FiCaSchedulerNode>
Throws:
Exception

serviceStart

public void serviceStart()
                  throws Exception
Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStop

public void serviceStop()
                 throws Exception
Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
Throws:
Exception

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

getNumClusterNodes

public int getNumClusterNodes()
Description copied from interface: YarnScheduler
Get the number of nodes available in the cluster.

Specified by:
getNumClusterNodes in interface YarnScheduler
Returns:
the number of available nodes.

setRMContext

public void setRMContext(RMContext rmContext)
Description copied from interface: ResourceScheduler
Set RMContext for ResourceScheduler. This method should be called immediately after instantiating a scheduler once.

Specified by:
setRMContext in interface ResourceScheduler
Parameters:
rmContext - created by ResourceManager

reinitialize

public void reinitialize(org.apache.hadoop.conf.Configuration conf,
                         RMContext rmContext)
                  throws IOException
Description copied from interface: ResourceScheduler
Re-initialize the ResourceScheduler.

Specified by:
reinitialize in interface ResourceScheduler
Parameters:
conf - configuration
Throws:
IOException

allocate

public Allocation allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
                           List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask,
                           List<org.apache.hadoop.yarn.api.records.ContainerId> release,
                           List<String> blacklistAdditions,
                           List<String> blacklistRemovals)
Description copied from interface: YarnScheduler
The main api between the ApplicationMaster and the Scheduler. The ApplicationMaster is updating his future resource requirements and may release containers he doens't need.

Specified by:
allocate in interface YarnScheduler
Returns:
the Allocation for the application

addApplication

public void addApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
                           String queue,
                           String user,
                           boolean isAppRecovering)

addApplicationAttempt

public void addApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
                                  boolean transferStateFromPreviousAttempt,
                                  boolean isAttemptRecovering)

handle

public void handle(SchedulerEvent event)
Specified by:
handle in interface org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>

completedContainer

@Lock(value=FifoScheduler.class)
protected void completedContainer(RMContainer rmContainer,
                                                          org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus,
                                                          RMContainerEventType event)
Specified by:
completedContainer in class AbstractYarnScheduler<FiCaSchedulerApp,FiCaSchedulerNode>

getQueueInfo

public org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(String queueName,
                                                                 boolean includeChildQueues,
                                                                 boolean recursive)
Description copied from interface: YarnScheduler
Get queue information

Specified by:
getQueueInfo in interface YarnScheduler
Parameters:
queueName - queue name
includeChildQueues - include child queues?
recursive - get children queues?
Returns:
queue information

getQueueUserAclInfo

public List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo()
Description copied from interface: YarnScheduler
Get acls for queues for current user.

Specified by:
getQueueUserAclInfo in interface YarnScheduler
Returns:
acls for queues for current user

recover

public void recover(RMStateStore.RMState state)
Specified by:
recover in interface Recoverable

getRMContainer

public RMContainer getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Description copied from interface: YarnScheduler
Get the container for the given containerId.

Specified by:
getRMContainer in interface YarnScheduler
Overrides:
getRMContainer in class AbstractYarnScheduler<FiCaSchedulerApp,FiCaSchedulerNode>
Returns:
the container for the given containerId.

getRootQueueMetrics

public QueueMetrics getRootQueueMetrics()
Description copied from interface: YarnScheduler
Get the root queue for the scheduler.

Specified by:
getRootQueueMetrics in interface YarnScheduler
Returns:
the root queue for the scheduler.

checkAccess

public boolean checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI,
                           org.apache.hadoop.yarn.api.records.QueueACL acl,
                           String queueName)
Description copied from interface: YarnScheduler
Check if the user has permission to perform the operation. If the user has QueueACL.ADMINISTER_QUEUE permission, this user can view/modify the applications in this queue

Specified by:
checkAccess in interface YarnScheduler
Returns:
true if the user has the permission, false otherwise

getAppsInQueue

public List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> getAppsInQueue(String queueName)
Description copied from interface: YarnScheduler
Gets the apps under a given queue

Specified by:
getAppsInQueue in interface YarnScheduler
Parameters:
queueName - the name of the queue.
Returns:
a collection of app attempt ids in the given queue.

getUsedResource

public org.apache.hadoop.yarn.api.records.Resource getUsedResource()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.