java.lang.Object
org.apache.hadoop.yarn.server.globalpolicygenerator.policygenerator.PolicyGenerator
All Implemented Interfaces:
Runnable, org.apache.hadoop.conf.Configurable

public class PolicyGenerator extends Object implements Runnable, org.apache.hadoop.conf.Configurable
The PolicyGenerator runs periodically and updates the policy configuration for each queue into the FederationStateStore. The policy update behavior is defined by the GlobalPolicy instance that is used.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PolicyGenerator(org.apache.hadoop.conf.Configuration conf, GPGContext context)
    The PolicyGenerator periodically reads SubCluster load and updates policies into the FederationStateStore.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.conf.Configuration
     
    protected Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,Map<Class,Object>>
    getInfos(Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,org.apache.hadoop.yarn.server.federation.store.records.SubClusterInfo> activeSubClusters)
    Helper to retrieve metrics from the RM REST endpoints.
     
    protected Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerInfo>
    getSchedulerInfo(Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,org.apache.hadoop.yarn.server.federation.store.records.SubClusterInfo> activeSubClusters)
    Helper to retrieve SchedulerInfos.
    final void
    run()
     
    void
    setConf(org.apache.hadoop.conf.Configuration conf)
     
    void
     

    Methods inherited from class java.lang.Object

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

    • PolicyGenerator

      public PolicyGenerator(org.apache.hadoop.conf.Configuration conf, GPGContext context)
      The PolicyGenerator periodically reads SubCluster load and updates policies into the FederationStateStore.
      Parameters:
      conf - Configuration.
      context - GPG Context.
  • 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
    • run

      public final void run()
      Specified by:
      run in interface Runnable
    • getInfos

      @VisibleForTesting protected Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,Map<Class,Object>> getInfos(Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,org.apache.hadoop.yarn.server.federation.store.records.SubClusterInfo> activeSubClusters)
      Helper to retrieve metrics from the RM REST endpoints.
      Parameters:
      activeSubClusters - A map of active SubCluster IDs to info
      Returns:
      Mapping relationship between SubClusterId and Metric.
    • getSchedulerInfo

      @VisibleForTesting protected Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerInfo> getSchedulerInfo(Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,org.apache.hadoop.yarn.server.federation.store.records.SubClusterInfo> activeSubClusters)
      Helper to retrieve SchedulerInfos.
      Parameters:
      activeSubClusters - A map of active SubCluster IDs to info
      Returns:
      Mapping relationship between SubClusterId and SubClusterInfo.
    • getPolicy

      public GlobalPolicy getPolicy()
    • setPolicy

      public void setPolicy(GlobalPolicy policy)