Class DefaultRequestInterceptor
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AbstractRequestInterceptor
org.apache.hadoop.yarn.server.nodemanager.amrmproxy.DefaultRequestInterceptor
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.yarn.api.ApplicationMasterProtocol,org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol,RequestInterceptor
Extends the AbstractRequestInterceptor class and provides an implementation
that simply forwards the AM requests to the cluster resource manager.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.protocolrecords.AllocateResponseallocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request) 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) static org.apache.hadoop.io.TextgetTokenService(org.apache.hadoop.conf.Configuration conf, String address, String defaultAddr, int defaultPort) voidinit(AMRMProxyApplicationContext appContext) Initializes theRequestInterceptor.org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponseregisterApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) 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.voidSets theRequestInterceptorin the chain.voidsetRMClient(org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmClient) Methods inherited from class org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AbstractRequestInterceptor
getApplicationContext, getConf, getNextInterceptor, getNMStateStore, recover, setConf, shutdown
-
Constructor Details
-
DefaultRequestInterceptor
public DefaultRequestInterceptor()
-
-
Method Details
-
init
Description copied from class:AbstractRequestInterceptorInitializes theRequestInterceptor.- Specified by:
initin interfaceRequestInterceptor- Overrides:
initin classAbstractRequestInterceptor- Parameters:
appContext- 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 - Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
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 - 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
-
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
-
setNextInterceptor
Description copied from class:AbstractRequestInterceptorSets theRequestInterceptorin the chain.- Specified by:
setNextInterceptorin interfaceRequestInterceptor- Overrides:
setNextInterceptorin classAbstractRequestInterceptor- Parameters:
next- the next interceptor to set
-
setRMClient
@VisibleForTesting public void setRMClient(org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmClient) -
getTokenService
-