public class LocalityRouterPolicy extends WeightedRandomRouterPolicy
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
LocalityRouterPolicy() |
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 query name.
|
void |
reinitialize(FederationPolicyInitializationContext policyContext)
This method is invoked to initialize of update the configuration of
policies.
|
chooseSubCluster
getReservationHomeSubcluster, prefilterSubClusters, validate, validate
getActiveSubclusters, getIsDirty, getPolicyContext, getPolicyInfo, setPolicyContext, setPolicyInfo
public void reinitialize(FederationPolicyInitializationContext policyContext) throws FederationPolicyInitializationException
ConfigurableFederationPolicy
reinitialize
in interface ConfigurableFederationPolicy
reinitialize
in class AbstractConfigurableFederationPolicy
policyContext
- 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
AbstractRouterPolicy
getHomeSubcluster
in interface FederationRouterPolicy
getHomeSubcluster
in class AbstractRouterPolicy
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–2024 Apache Software Foundation. All rights reserved.