Interface ResourceScheduler

All Superinterfaces:
org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>, Recoverable, YarnScheduler
All Known Subinterfaces:
MutableConfScheduler, PreemptableResourceScheduler
All Known Implementing Classes:
AbstractYarnScheduler, CapacityScheduler, FairScheduler, FifoScheduler

@LimitedPrivate("yarn") @Evolving public interface ResourceScheduler extends YarnScheduler, Recoverable
This interface is the one implemented by the schedulers. It mainly extends YarnScheduler.
  • Method Details

    • setRMContext

      void setRMContext(RMContext rmContext)
      Set RMContext for ResourceScheduler. This method should be called immediately after instantiating a scheduler once.
      Parameters:
      rmContext - created by ResourceManager
    • reinitialize

      void reinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext) throws IOException
      Re-initialize the ResourceScheduler.
      Parameters:
      conf - configuration
      rmContext - RMContext.
      Throws:
      IOException - an I/O exception has occurred.
    • getNodeIds

      List<org.apache.hadoop.yarn.api.records.NodeId> getNodeIds(String resourceName)
      Get the NodeId available in the cluster by resource name.
      Parameters:
      resourceName - resource name
      Returns:
      the number of available NodeId by resource name.
    • attemptAllocationOnNode

      boolean attemptAllocationOnNode(SchedulerApplicationAttempt appAttempt, org.apache.hadoop.yarn.api.records.SchedulingRequest schedulingRequest, SchedulerNode schedulerNode)
      Attempts to allocate a SchedulerRequest on a Node. NOTE: This ignores the numAllocations in the resource sizing and tries to allocate a SINGLE container only.
      Parameters:
      appAttempt - ApplicationAttempt.
      schedulingRequest - SchedulingRequest.
      schedulerNode - SchedulerNode.
      Returns:
      true if proposal was accepted.
    • resetSchedulerMetrics

      void resetSchedulerMetrics()
      Reset scheduler metrics.