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
The DistributedScheduler runs on the NodeManager and is modeled as an
AMRMProxy request interceptor. It is responsible for the
following:
- Intercept
ApplicationMasterProtocolcalls and unwrap the response objects to extract instructions from theClusterMonitorrunning on the ResourceManager to aid in making distributed scheduling decisions. - Call the
OpportunisticContainerAllocatorto allocate containers for the outstanding OPPORTUNISTIC container requests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.protocolrecords.AllocateResponseallocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request) Route allocate call to the allocateForDistributedScheduling method and return response to the caller after stripping away Distributed Scheduling information.org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateResponseallocateForDistributedScheduling(org.apache.hadoop.yarn.server.api.protocolrecords.DistributedSchedulingAllocateRequest request) Default implementation that invokes the distributed scheduling version of the register method.org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponsefinishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request) voidinit(AMRMProxyApplicationContext applicationContext) Initializes theRequestInterceptor.org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponseregisterApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) Route register call to the corresponding distributed scheduling method viz.org.apache.hadoop.yarn.server.api.protocolrecords.RegisterDistributedSchedulingAMResponseregisterApplicationMasterForDistributedScheduling(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) Default implementation that invokes the distributed scheduling version of the allocate method.Methods inherited from class org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AbstractRequestInterceptor
getApplicationContext, getConf, getNextInterceptor, getNMStateStore, recover, setConf, setNextInterceptor, shutdown
-
Constructor Details
-
DistributedScheduler
public DistributedScheduler()
-
-
Method Details
-
init
Description copied from class:AbstractRequestInterceptorInitializes theRequestInterceptor.- Specified by:
initin interfaceRequestInterceptor- Overrides:
initin classAbstractRequestInterceptor- 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- YarnExceptionIOException- 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- YarnExceptionIOException- 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.YarnExceptionIOException
-
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:AbstractRequestInterceptorDefault implementation that invokes the distributed scheduling version of the allocate method.- Specified by:
registerApplicationMasterForDistributedSchedulingin interfaceorg.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol- Overrides:
registerApplicationMasterForDistributedSchedulingin classAbstractRequestInterceptor- Parameters:
request- ApplicationMaster registration request- Returns:
- Distributed Scheduler Register Response
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if failsIOException- 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:AbstractRequestInterceptorDefault implementation that invokes the distributed scheduling version of the register method.- Specified by:
allocateForDistributedSchedulingin interfaceorg.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol- Overrides:
allocateForDistributedSchedulingin classAbstractRequestInterceptor- Parameters:
request- ApplicationMaster allocate request- Returns:
- Distribtued Scheduler Allocate Response
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if failsIOException- if fails
-