java.lang.Object
org.apache.hadoop.yarn.server.globalpolicygenerator.policygenerator.GlobalPolicy
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
LoadBasedGlobalPolicy, NoOpGlobalPolicy, UniformWeightedLocalityGlobalPolicy

public abstract class GlobalPolicy extends Object implements org.apache.hadoop.conf.Configurable
This interface defines the plug-able policy that the PolicyGenerator uses to update policies into the state store.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.conf.Configuration
     
    protected Map<Class<?>,String>
    Return a map of the object type and RM path to request it from - the framework will query these paths and provide the objects to the policy.
    void
    setConf(org.apache.hadoop.conf.Configuration conf)
     
    protected abstract org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager
    updatePolicy(String queueName, Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,Map<Class,Object>> clusterInfo, org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager manager)
    Given a queue, cluster metrics, and policy manager, update the policy to account for the cluster status.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GlobalPolicy

      public GlobalPolicy()
  • Method Details

    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Specified by:
      setConf in interface org.apache.hadoop.conf.Configurable
    • getConf

      public org.apache.hadoop.conf.Configuration getConf()
      Specified by:
      getConf in interface org.apache.hadoop.conf.Configurable
    • registerPaths

      protected Map<Class<?>,String> registerPaths()
      Return a map of the object type and RM path to request it from - the framework will query these paths and provide the objects to the policy. Delegating this responsibility to the PolicyGenerator enables us to avoid duplicate calls to the same * endpoints as the GlobalPolicy is invoked once per queue.
      Returns:
      a map of the object type and RM path.
    • updatePolicy

      protected abstract org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager updatePolicy(String queueName, Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,Map<Class,Object>> clusterInfo, org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager manager)
      Given a queue, cluster metrics, and policy manager, update the policy to account for the cluster status. This method defines the policy generator behavior.
      Parameters:
      queueName - name of the queue
      clusterInfo - subClusterId map to cluster information about the SubCluster used to make policy decisions
      manager - the FederationPolicyManager for the queue's existing policy the manager may be null, in which case the policy will need to be created
      Returns:
      policy manager that handles the updated (or created) policy