Interface FederationAMRMProxyPolicy

All Superinterfaces:
ConfigurableFederationPolicy
All Known Implementing Classes:
AbstractAMRMProxyPolicy, BroadcastAMRMProxyPolicy, HomeAMRMProxyPolicy, LocalityMulticastAMRMProxyPolicy, RejectAMRMProxyPolicy

public interface FederationAMRMProxyPolicy extends ConfigurableFederationPolicy
Implementors of this interface provide logic to split the list of ResourceRequests received by the AM among various RMs.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    notifyOfResponse(SubClusterId subClusterId, org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse response)
    This method should be invoked to notify the policy about responses being received.
    Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>>
    splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests, Set<SubClusterId> timedOutSubClusters)
    Splits the ResourceRequests from the client across one or more sub-clusters based on the policy semantics (e.g., broadcast, load-based).

    Methods inherited from interface org.apache.hadoop.yarn.server.federation.policies.ConfigurableFederationPolicy

    reinitialize
  • Method Details

    • splitResourceRequests

      Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>> splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests, Set<SubClusterId> timedOutSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException
      Splits the ResourceRequests from the client across one or more sub-clusters based on the policy semantics (e.g., broadcast, load-based).
      Parameters:
      resourceRequests - the list of ResourceRequests from the AM to be split
      timedOutSubClusters - the set of sub-clusters that haven't had a successful heart-beat response for a while.
      Returns:
      map of sub-cluster as identified by SubClusterId to the list of ResourceRequests 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.
    • notifyOfResponse

      void notifyOfResponse(SubClusterId subClusterId, org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse response) throws org.apache.hadoop.yarn.exceptions.YarnException
      This method should be invoked to notify the policy about responses being received. This is useful for stateful policies that make decisions based on previous responses being received.
      Parameters:
      subClusterId - the id of the subcluster sending the notification
      response - the response received from one of the RMs
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - in case the response is not valid