Class WeightedRandomRouterPolicy
java.lang.Object
org.apache.hadoop.yarn.server.federation.policies.AbstractConfigurableFederationPolicy
org.apache.hadoop.yarn.server.federation.policies.router.AbstractRouterPolicy
org.apache.hadoop.yarn.server.federation.policies.router.WeightedRandomRouterPolicy
- All Implemented Interfaces:
ConfigurableFederationPolicy,FederationRouterPolicy
- Direct Known Subclasses:
LocalityRouterPolicy
This policy implements a weighted random sample among currently active
sub-clusters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SubClusterIdchooseSubCluster(String queue, Map<SubClusterId, SubClusterInfo> preSelectSubclusters) This method is implemented by the specific policy, and it is used to route both reservations, and applications among a given set of sub-clusters.Methods inherited from class org.apache.hadoop.yarn.server.federation.policies.router.AbstractRouterPolicy
getHomeSubcluster, getReservationHomeSubcluster, prefilterSubClusters, validate, validateMethods inherited from class org.apache.hadoop.yarn.server.federation.policies.AbstractConfigurableFederationPolicy
getActiveSubclusters, getIsDirty, getPolicyContext, getPolicyInfo, reinitialize, setPolicyContext, setPolicyInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.yarn.server.federation.policies.ConfigurableFederationPolicy
reinitialize
-
Constructor Details
-
WeightedRandomRouterPolicy
public WeightedRandomRouterPolicy()
-
-
Method Details
-
chooseSubCluster
protected SubClusterId chooseSubCluster(String queue, Map<SubClusterId, SubClusterInfo> preSelectSubclusters) throws org.apache.hadoop.yarn.exceptions.YarnExceptionDescription copied from class:AbstractRouterPolicyThis method is implemented by the specific policy, and it is used to route both reservations, and applications among a given set of sub-clusters.- Specified by:
chooseSubClusterin classAbstractRouterPolicy- Parameters:
queue- the queue for this application/reservationpreSelectSubclusters- a pre-filter set of sub-clusters- Returns:
- the chosen sub-cluster
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the policy fails to choose a sub-cluster
-