public class HashBasedRouterPolicy extends AbstractRouterPolicy
FederationRouterPolicy pick a subcluster based on the hash of
the job's queue name. Useful to provide a default behavior when too many
queues exist in a system. This also ensures that all jobs belonging to a
queue are mapped to the same sub-cluster (likely help with locality).| Constructor and Description |
|---|
HashBasedRouterPolicy() |
| Modifier and Type | Method and Description |
|---|---|
SubClusterId |
getHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext,
List<SubClusterId> blackListSubClusters)
Simply picks from alphabetically-sorted active subclusters based on the
hash of quey name.
|
void |
reinitialize(FederationPolicyInitializationContext federationPolicyContext)
This method is invoked to initialize of update the configuration of
policies.
|
validate, validategetActiveSubclusters, getIsDirty, getPolicyContext, getPolicyInfo, setPolicyContext, setPolicyInfopublic void reinitialize(FederationPolicyInitializationContext federationPolicyContext) throws FederationPolicyInitializationException
ConfigurableFederationPolicyreinitialize in interface ConfigurableFederationPolicyreinitialize in class AbstractConfigurableFederationPolicyfederationPolicyContext - the new context to provide to implementor.FederationPolicyInitializationException - in case the initialization
fails.public SubClusterId getHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException
appSubmissionContext - the ApplicationSubmissionContext that
has to be routed to an appropriate subCluster for execution.blackListSubClusters - the list of subClusters as identified by
SubClusterId to blackList from the selection of the home
subCluster.SubClusterId that will be the "home"
for this application.org.apache.hadoop.yarn.exceptions.YarnException - if there are no active subclusters.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.