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

## Class BroadcastAMRMProxyPolicy

- java.lang.Object
- - org.apache.hadoop.yarn.server.federation.policies.AbstractConfigurableFederationPolicy
  - - org.apache.hadoop.yarn.server.federation.policies.amrmproxy.AbstractAMRMProxyPolicy
    - - org.apache.hadoop.yarn.server.federation.policies.amrmproxy.BroadcastAMRMProxyPolicy

- All Implemented Interfaces:
    FederationAMRMProxyPolicy, ConfigurableFederationPolicy

      public class BroadcastAMRMProxyPolicy
      extends AbstractAMRMProxyPolicy

  An implementation of the `FederationAMRMProxyPolicy` that simply broadcasts each `ResourceRequest` to all the available sub-clusters.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BroadcastAMRMProxyPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `reinitialize(FederationPolicyInitializationContext policyContext)` This method is invoked to initialize of update the configuration of policies.
    `Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>>` | `splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests)` Splits the `ResourceRequest`s from the client across one or more sub-clusters based on the policy semantics (e.g., broadcast, load-based).

    - ### Methods inherited from class org.apache.hadoop.yarn.server.federation.policies.amrmproxy.AbstractAMRMProxyPolicy

      `notifyOfResponse, validate`

    - ### Methods inherited from class org.apache.hadoop.yarn.server.federation.policies.AbstractConfigurableFederationPolicy

      `getActiveSubclusters, getIsDirty, getPolicyContext, getPolicyInfo, setPolicyContext, setPolicyInfo`

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

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

- - ### Constructor Detail

    - #### BroadcastAMRMProxyPolicy

          public BroadcastAMRMProxyPolicy()

  - ### Method Detail

    - #### reinitialize

          public void reinitialize(FederationPolicyInitializationContext policyContext)
                            throws FederationPolicyInitializationException

      Description copied from interface: `ConfigurableFederationPolicy`
      This method is invoked to initialize of update the configuration of policies. The implementor should provide try-n-swap semantics, and retain state if possible.
      Specified by:
        `reinitialize` in interface `ConfigurableFederationPolicy`
      Overrides:
        `reinitialize` in class `AbstractConfigurableFederationPolicy`
      Parameters:
        `policyContext` - the new context to provide to implementor.
      Throws:
        `FederationPolicyInitializationException` - in case the initialization fails.

    - #### splitResourceRequests

          public Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>> splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests)
                                                                                                           throws org.apache.hadoop.yarn.exceptions.YarnException

      Description copied from interface: `FederationAMRMProxyPolicy`
      Splits the `ResourceRequest`s from the client across one or more sub-clusters based on the policy semantics (e.g., broadcast, load-based).
      Parameters:
        `resourceRequests` - the list of `ResourceRequest`s from the AM to be split
      Returns:
        map of sub-cluster as identified by `SubClusterId` to the list of `ResourceRequest`s that should be forwarded to it
      Throws:
        `org.apache.hadoop.yarn.exceptions.YarnException` - in case the request is malformed or no viable sub-clusters can be found.

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