org.apache.hadoop.yarn.server.federation.policies

## Class RouterPolicyFacade

- java.lang.Object
- - org.apache.hadoop.yarn.server.federation.policies.RouterPolicyFacade

-     public class RouterPolicyFacade
      extends Object

  This class provides a facade to the policy subsystem, and handles the lifecycle of policies (e.g., refresh from remote, default behaviors etc.).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RouterPolicyFacade(org.apache.hadoop.conf.Configuration conf, FederationStateStoreFacade facade, SubClusterResolver resolver, SubClusterId homeSubcluster)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SubClusterId` | `getHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters)` This method provides a wrapper of all policy functionalities for routing .
    `void` | `reset()` This method flushes all cached configurations and policies.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RouterPolicyFacade

          public RouterPolicyFacade(org.apache.hadoop.conf.Configuration conf,
                                    FederationStateStoreFacade facade,
                                    SubClusterResolver resolver,
                                    SubClusterId homeSubcluster)
                             throws FederationPolicyInitializationException

      Throws:
        `FederationPolicyInitializationException`

  - ### Method Detail

    - #### getHomeSubcluster

          public SubClusterId getHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext,
                                                List<SubClusterId> blackListSubClusters)
                                         throws org.apache.hadoop.yarn.exceptions.YarnException

      This method provides a wrapper of all policy functionalities for routing . Internally it manages configuration changes, and policy init/reinit.
      Parameters:
        `appSubmissionContext` - the `ApplicationSubmissionContext` that has to be routed to an appropriate subCluster for execution.
        `blackListSubClusters` - the list of subClusters as identified by `SubClusterId` to blackList from the selection of the home subCluster.
      Returns:
        the `SubClusterId` that will be the "home" for this application.
      Throws:
        `org.apache.hadoop.yarn.exceptions.YarnException` - if there are issues initializing policies, or no valid sub-cluster id could be found for this app.

    - #### reset

          public void reset()

      This method flushes all cached configurations and policies. This should be invoked if the facade remains activity after very large churn of queues in the system.

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