Class AbstractPolicyManager
java.lang.Object
org.apache.hadoop.yarn.server.federation.policies.manager.AbstractPolicyManager
- All Implemented Interfaces:
FederationPolicyManager
- Direct Known Subclasses:
HashBroadcastPolicyManager,HomePolicyManager,PriorityBroadcastPolicyManager,RejectAllPolicyManager,UniformBroadcastPolicyManager,WeightedHomePolicyManager,WeightedLocalityPolicyManager
This class provides basic implementation for common methods that multiple
policies will need to implement.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAMRMPolicy(FederationPolicyInitializationContext federationPolicyContext, FederationAMRMProxyPolicy oldInstance) This default implementation validates theFederationPolicyInitializationContext, then checks whether it needs to reinstantiate the class (null or mismatching type), and reinitialize the policy.getQueue()This method returns the queue this policy is configured for.getRouterPolicy(FederationPolicyInitializationContext federationPolicyContext, FederationRouterPolicy oldInstance) This default implementation validates theFederationPolicyInitializationContext, then checks whether it needs to reinstantiate the class (null or mismatching type), and reinitialize the policy.abstract WeightedPolicyInfoWe get the WeightedPolicyInfo of the subCluster.This method is invoked to derive aSubClusterPolicyConfiguration.voidThis methods provides a setter for the queue this policy is specified for.abstract voidsetWeightedPolicyInfo(WeightedPolicyInfo weightedPolicyInfo) We set the WeightedPolicyInfo of the subCluster.Methods 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.manager.FederationPolicyManager
isSupportWeightedPolicyInfo
-
Field Details
-
routerFederationPolicy
-
amrmProxyFederationPolicy
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
AbstractPolicyManager
public AbstractPolicyManager()
-
-
Method Details
-
getAMRMPolicy
public FederationAMRMProxyPolicy getAMRMPolicy(FederationPolicyInitializationContext federationPolicyContext, FederationAMRMProxyPolicy oldInstance) throws FederationPolicyInitializationException This default implementation validates theFederationPolicyInitializationContext, then checks whether it needs to reinstantiate the class (null or mismatching type), and reinitialize the policy.- Specified by:
getAMRMPolicyin interfaceFederationPolicyManager- Parameters:
federationPolicyContext- the current contextoldInstance- the existing (possibly null) instance.- Returns:
- a valid and fully reinitialized
FederationAMRMProxyPolicyinstance - Throws:
FederationPolicyInitializationException- if the reinitialization is not valid, and ensure previous state is preserved
-
getRouterPolicy
public FederationRouterPolicy getRouterPolicy(FederationPolicyInitializationContext federationPolicyContext, FederationRouterPolicy oldInstance) throws FederationPolicyInitializationException This default implementation validates theFederationPolicyInitializationContext, then checks whether it needs to reinstantiate the class (null or mismatching type), and reinitialize the policy.- Specified by:
getRouterPolicyin interfaceFederationPolicyManager- Parameters:
federationPolicyContext- the current contextoldInstance- the existing (possibly null) instance.- Returns:
- a valid and fully reinitialized
FederationRouterPolicyinstance - Throws:
FederationPolicyInitializationException- if the reinitialization is not valid, and ensure previous state is preserved
-
serializeConf
Description copied from interface:FederationPolicyManagerThis method is invoked to derive aSubClusterPolicyConfiguration. This is to be used when writing a policy object in the federation policy store.- Specified by:
serializeConfin interfaceFederationPolicyManager- Returns:
- a valid policy configuration representing this object parametrization.
- Throws:
FederationPolicyInitializationException- if the current state cannot be serialized properly
-
getQueue
Description copied from interface:FederationPolicyManagerThis method returns the queue this policy is configured for.- Specified by:
getQueuein interfaceFederationPolicyManager- Returns:
- the name of the queue.
-
setQueue
Description copied from interface:FederationPolicyManagerThis methods provides a setter for the queue this policy is specified for.- Specified by:
setQueuein interfaceFederationPolicyManager- Parameters:
queue- the name of the queue.
-
getWeightedPolicyInfo
We get the WeightedPolicyInfo of the subCluster.- Specified by:
getWeightedPolicyInfoin interfaceFederationPolicyManager- Returns:
- WeightedPolicyInfo.
-
setWeightedPolicyInfo
We set the WeightedPolicyInfo of the subCluster.- Specified by:
setWeightedPolicyInfoin interfaceFederationPolicyManager- Parameters:
weightedPolicyInfo- weightedPolicyInfo of the subCluster.
-