Class PolicyGenerator
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
ConstructorsConstructorDescriptionPolicyGenerator(org.apache.hadoop.conf.Configuration conf, GPGContext context) The PolicyGenerator periodically reads SubCluster load and updates policies into the FederationStateStore. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.conf.ConfigurationgetConf()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 voidrun()voidsetConf(org.apache.hadoop.conf.Configuration conf) voidsetPolicy(GlobalPolicy policy)
-
Constructor Details
-
PolicyGenerator
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:
setConfin interfaceorg.apache.hadoop.conf.Configurable
-
getConf
public org.apache.hadoop.conf.Configuration getConf()- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
run
public final void run() -
getInfos
@VisibleForTesting protected Map<org.apache.hadoop.yarn.server.federation.store.records.SubClusterId,Map<Class, getInfosObject>> (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
-
setPolicy
-