Class AbstractRequestInterceptor
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AbstractRequestInterceptor
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.yarn.api.ApplicationMasterProtocol,org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol,RequestInterceptor
- Direct Known Subclasses:
DefaultRequestInterceptor,DistributedScheduler,FederationInterceptor
Implements the RequestInterceptor interface and provides common functionality
which can can be used and/or extended by other concrete interceptor classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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.Gets theAMRMProxyApplicationContext.org.apache.hadoop.conf.ConfigurationgetConf()Gets theConfiguration.Gets the nextRequestInterceptorin the chain.A helper method for getting NM state store.voidinit(AMRMProxyApplicationContext appContext) Initializes theRequestInterceptor.voidRecoverRequestInterceptorstate from store.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.voidsetConf(org.apache.hadoop.conf.Configuration conf) Sets theConfiguration.voidsetNextInterceptor(RequestInterceptor nextInterceptor) Sets theRequestInterceptorin the chain.voidshutdown()Disposes theRequestInterceptor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.yarn.api.ApplicationMasterProtocol
allocate, finishApplicationMaster, registerApplicationMaster
-
Constructor Details
-
AbstractRequestInterceptor
public AbstractRequestInterceptor()
-
-
Method Details
-
setNextInterceptor
Sets theRequestInterceptorin the chain.- Specified by:
setNextInterceptorin interfaceRequestInterceptor- Parameters:
nextInterceptor- the next interceptor to set
-
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) Sets theConfiguration.- Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable
-
getConf
public org.apache.hadoop.conf.Configuration getConf()Gets theConfiguration.- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
init
Initializes theRequestInterceptor.- Specified by:
initin interfaceRequestInterceptor- Parameters:
appContext- AMRMProxy application context
-
recover
RecoverRequestInterceptorstate from store.- Specified by:
recoverin interfaceRequestInterceptor- Parameters:
recoveredDataMap- states for all interceptors recovered from NMSS
-
shutdown
public void shutdown()Disposes theRequestInterceptor.- Specified by:
shutdownin interfaceRequestInterceptor
-
getNextInterceptor
Gets the nextRequestInterceptorin the chain.- Specified by:
getNextInterceptorin interfaceRequestInterceptor- Returns:
- the next interceptor in the chain
-
getApplicationContext
Gets theAMRMProxyApplicationContext.- Specified by:
getApplicationContextin interfaceRequestInterceptor- Returns:
- the context
-
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 Default implementation that invokes the distributed scheduling version of the register method.- Specified by:
allocateForDistributedSchedulingin interfaceorg.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol- Parameters:
request- ApplicationMaster allocate request- Returns:
- Distribtued Scheduler Allocate Response
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if failsIOException- if fails
-
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 Default implementation that invokes the distributed scheduling version of the allocate method.- Specified by:
registerApplicationMasterForDistributedSchedulingin interfaceorg.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol- Parameters:
request- ApplicationMaster registration request- Returns:
- Distributed Scheduler Register Response
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if failsIOException- if fails
-
getNMStateStore
A helper method for getting NM state store.- Returns:
- the NMSS instance
-