org.apache.hadoop.yarn.server.nodemanager.amrmproxy

## Interface RequestInterceptor

- All Superinterfaces:
    org.apache.hadoop.yarn.api.ApplicationMasterProtocol, org.apache.hadoop.conf.Configurable, org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol
  All Known Implementing Classes:
    AbstractRequestInterceptor, DefaultRequestInterceptor, DistributedScheduler, FederationInterceptor

      public interface RequestInterceptor
      extends org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol, org.apache.hadoop.conf.Configurable

  Defines the contract to be implemented by the request intercepter classes, that can be used to intercept and inspect messages sent from the application master to the resource manager.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `AMRMProxyApplicationContext` | `getApplicationContext()` Returns the context.
    `RequestInterceptor` | `getNextInterceptor()` Returns the next intercepter in the chain.
    `void` | `init(AMRMProxyApplicationContext ctx)` This method is called for initializing the intercepter.
    `void` | `recover(Map<String,byte[]> recoveredDataMap)` Recover intercepter state when NM recovery is enabled.
    `void` | `setNextInterceptor(RequestInterceptor nextInterceptor)` Sets the next intercepter in the pipeline.
    `void` | `shutdown()` This method is called to release the resources held by the intercepter.

    - ### Methods inherited from interface org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol

      `allocateForDistributedScheduling, registerApplicationMasterForDistributedScheduling`

    - ### Methods inherited from interface org.apache.hadoop.yarn.api.ApplicationMasterProtocol

      `allocate, finishApplicationMaster, registerApplicationMaster`

    - ### Methods inherited from interface org.apache.hadoop.conf.Configurable

      `getConf, setConf`

- - ### Method Detail

    - #### init

          void init(AMRMProxyApplicationContext ctx)

      This method is called for initializing the intercepter. This is guaranteed to be called only once in the lifetime of this instance.
      Parameters:
        `ctx` - AMRMProxy application context

    - #### recover

          void recover(Map<String,byte[]> recoveredDataMap)

      Recover intercepter state when NM recovery is enabled. AMRMProxy will recover the data map into AMRMProxyApplicationContext.getRecoveredDataMap(). All intercepters should recover state from it. For example, registerRequest has to be saved by the last intercepter (i.e. the one that actually connects to RM), in order to re-register when RM fails over.
      Parameters:
        `recoveredDataMap` - states for all intercepters recovered from NMSS

    - #### shutdown

          void shutdown()

      This method is called to release the resources held by the intercepter. This will be called when the application pipeline is being destroyed. The concrete implementations should dispose the resources and forward the request to the next intercepter, if any.

    - #### setNextInterceptor

          void setNextInterceptor(RequestInterceptor nextInterceptor)

      Sets the next intercepter in the pipeline. The concrete implementation of this interface should always pass the request to the nextInterceptor after inspecting the message. The last intercepter in the chain is responsible to send the messages to the resource manager service and so the last intercepter will not receive this method call.
      Parameters:
        `nextInterceptor` - the next intercepter to set

    - #### getNextInterceptor

          RequestInterceptor getNextInterceptor()

      Returns the next intercepter in the chain.
      Returns:
        the next intercepter in the chain

    - #### getApplicationContext

          AMRMProxyApplicationContext getApplicationContext()

      Returns the context.
      Returns:
        the context

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.