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

public abstract class AbstractRequestInterceptor extends Object implements RequestInterceptor
Implements the RequestInterceptor interface and provides common functionality which can can be used and/or extended by other concrete interceptor classes.
  • Constructor Details

    • AbstractRequestInterceptor

      public AbstractRequestInterceptor()
  • Method Details

    • setNextInterceptor

      public void setNextInterceptor(RequestInterceptor nextInterceptor)
      Sets the RequestInterceptor in the chain.
      Specified by:
      setNextInterceptor in interface RequestInterceptor
      Parameters:
      nextInterceptor - the next interceptor to set
    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Sets the Configuration.
      Specified by:
      setConf in interface org.apache.hadoop.conf.Configurable
    • getConf

      public org.apache.hadoop.conf.Configuration getConf()
      Gets the Configuration.
      Specified by:
      getConf in interface org.apache.hadoop.conf.Configurable
    • init

      public void init(AMRMProxyApplicationContext appContext)
      Initializes the RequestInterceptor.
      Specified by:
      init in interface RequestInterceptor
      Parameters:
      appContext - AMRMProxy application context
    • recover

      public void recover(Map<String,byte[]> recoveredDataMap)
      Recover RequestInterceptor state from store.
      Specified by:
      recover in interface RequestInterceptor
      Parameters:
      recoveredDataMap - states for all interceptors recovered from NMSS
    • shutdown

      public void shutdown()
      Disposes the RequestInterceptor.
      Specified by:
      shutdown in interface RequestInterceptor
    • getNextInterceptor

      public RequestInterceptor getNextInterceptor()
      Gets the next RequestInterceptor in the chain.
      Specified by:
      getNextInterceptor in interface RequestInterceptor
      Returns:
      the next interceptor in the chain
    • getApplicationContext

      public AMRMProxyApplicationContext getApplicationContext()
      Specified by:
      getApplicationContext in interface RequestInterceptor
      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:
      allocateForDistributedScheduling in interface org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol
      Parameters:
      request - ApplicationMaster allocate request
      Returns:
      Distribtued Scheduler Allocate Response
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if fails
      IOException - 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:
      registerApplicationMasterForDistributedScheduling in interface org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol
      Parameters:
      request - ApplicationMaster registration request
      Returns:
      Distributed Scheduler Register Response
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if fails
      IOException - if fails
    • getNMStateStore

      public NMStateStoreService getNMStateStore()
      A helper method for getting NM state store.
      Returns:
      the NMSS instance