Class GlobalPolicy
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
This interface defines the plug-able policy that the PolicyGenerator uses
to update policies into the state store.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.conf.ConfigurationgetConf()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.voidsetConf(org.apache.hadoop.conf.Configuration conf) protected abstract org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManagerupdatePolicy(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.
-
Constructor Details
-
GlobalPolicy
public GlobalPolicy()
-
-
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
-
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 queueclusterInfo- subClusterId map to cluster information about the SubCluster used to make policy decisionsmanager- 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
-