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

public final class DefaultRequestInterceptor extends AbstractRequestInterceptor
Extends the AbstractRequestInterceptor class and provides an implementation that simply forwards the AM requests to the cluster resource manager.
  • Constructor Details

    • DefaultRequestInterceptor

      public DefaultRequestInterceptor()
  • Method Details

    • init

      public void init(AMRMProxyApplicationContext appContext)
      Description copied from class: AbstractRequestInterceptor
      Initializes the RequestInterceptor.
      Specified by:
      init in interface RequestInterceptor
      Overrides:
      init in class AbstractRequestInterceptor
      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.YarnException
      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
      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
    • 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
    • setNextInterceptor

      public void setNextInterceptor(RequestInterceptor next)
      Description copied from class: AbstractRequestInterceptor
      Sets the RequestInterceptor in the chain.
      Specified by:
      setNextInterceptor in interface RequestInterceptor
      Overrides:
      setNextInterceptor in class AbstractRequestInterceptor
      Parameters:
      next - the next interceptor to set
    • setRMClient

      @VisibleForTesting public void setRMClient(org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmClient)
    • getTokenService

      @Unstable public static org.apache.hadoop.io.Text getTokenService(org.apache.hadoop.conf.Configuration conf, String address, String defaultAddr, int defaultPort)