Class DistributedScheduler

java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AbstractRequestInterceptor
org.apache.hadoop.yarn.server.nodemanager.scheduler.DistributedScheduler
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.yarn.api.ApplicationMasterProtocol, org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol, RequestInterceptor

public final class DistributedScheduler extends AbstractRequestInterceptor

The DistributedScheduler runs on the NodeManager and is modeled as an AMRMProxy request interceptor. It is responsible for the following:

  • Intercept ApplicationMasterProtocol calls and unwrap the response objects to extract instructions from the ClusterMonitor running on the ResourceManager to aid in making distributed scheduling decisions.
  • Call the OpportunisticContainerAllocator to allocate containers for the outstanding OPPORTUNISTIC container requests.
  • Constructor Details

    • DistributedScheduler

      public DistributedScheduler()
  • Method Details

    • init

      public void init(AMRMProxyApplicationContext applicationContext)
      Description copied from class: AbstractRequestInterceptor
      Initializes the RequestInterceptor.
      Specified by:
      init in interface RequestInterceptor
      Overrides:
      init in class AbstractRequestInterceptor
      Parameters:
      applicationContext - AMRMProxy application context
    • registerApplicationMaster

      public org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Route register call to the corresponding distributed scheduling method viz. registerApplicationMasterForDistributedScheduling, and return response to the caller after stripping away Distributed Scheduling information.
      Parameters:
      request - registration request
      Returns:
      Allocate Response
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - YarnException
      IOException - IOException
    • allocate

      public org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Route allocate call to the allocateForDistributedScheduling method and return response to the caller after stripping away Distributed Scheduling information.
      Parameters:
      request - allocation request
      Returns:
      Allocate Response
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - YarnException
      IOException - IOException
    • finishApplicationMaster

      public org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
      IOException
    • registerApplicationMasterForDistributedScheduling

      public org.apache.hadoop.yarn.server.api.protocolrecords.RegisterDistributedSchedulingAMResponse registerApplicationMasterForDistributedScheduling(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Description copied from class: AbstractRequestInterceptor
      Default implementation that invokes the distributed scheduling version of the allocate method.
      Specified by:
      registerApplicationMasterForDistributedScheduling in interface org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol
      Overrides:
      registerApplicationMasterForDistributedScheduling in class AbstractRequestInterceptor
      Parameters:
      request - ApplicationMaster registration request
      Returns:
      Distributed Scheduler Register Response
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if fails
      IOException - if fails
    • allocateForDistributedScheduling

      public org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateResponse allocateForDistributedScheduling(org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Description copied from class: AbstractRequestInterceptor
      Default implementation that invokes the distributed scheduling version of the register method.
      Specified by:
      allocateForDistributedScheduling in interface org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol
      Overrides:
      allocateForDistributedScheduling in class AbstractRequestInterceptor
      Parameters:
      request - ApplicationMaster allocate request
      Returns:
      Distribtued Scheduler Allocate Response
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if fails
      IOException - if fails