public interface FederationPolicyManager
SubClusterPolicyConfiguration
, as well as provide
(re)initialization mechanics for the underlying
FederationAMRMProxyPolicy
and FederationRouterPolicy
.
The serialization aspects are used by admin APIs or a policy engine to store
a serialized configuration in the FederationStateStore
, while the
getters methods are used to obtain a properly initialized policy in the
Router
and AMRMProxy
respectively.
This interface by design binds together FederationAMRMProxyPolicy
and
FederationRouterPolicy
and provide lifecycle support for
serialization and deserialization, to reduce configuration mistakes
(combining incompatible policies).Modifier and Type | Method and Description |
---|---|
FederationAMRMProxyPolicy |
getAMRMPolicy(FederationPolicyInitializationContext policyContext,
FederationAMRMProxyPolicy oldInstance)
If the current instance is compatible, this method returns the same
instance of
FederationAMRMProxyPolicy reinitialized with the
current context, otherwise a new instance initialized with the current
context is provided. |
String |
getQueue()
This method returns the queue this policy is configured for.
|
FederationRouterPolicy |
getRouterPolicy(FederationPolicyInitializationContext policyContext,
FederationRouterPolicy oldInstance)
If the current instance is compatible, this method returns the same
instance of
FederationRouterPolicy reinitialized with the current
context, otherwise a new instance initialized with the current context is
provided. |
WeightedPolicyInfo |
getWeightedPolicyInfo()
This method returns the queue WeightedPolicyInfo
this policy is configured for.
|
boolean |
isSupportWeightedPolicyInfo()
PolicyManager Whether to support WeightedPolicyInfo.
|
SubClusterPolicyConfiguration |
serializeConf()
This method is invoked to derive a
SubClusterPolicyConfiguration . |
void |
setQueue(String queue)
This methods provides a setter for the queue this policy is specified for.
|
void |
setWeightedPolicyInfo(WeightedPolicyInfo weightedPolicyInfo)
This methods provides a setter for the queue WeightedPolicyInfo
this policy is specified for.
|
FederationAMRMProxyPolicy getAMRMPolicy(FederationPolicyInitializationContext policyContext, FederationAMRMProxyPolicy oldInstance) throws FederationPolicyInitializationException
FederationAMRMProxyPolicy
reinitialized with the
current context, otherwise a new instance initialized with the current
context is provided. If the instance is compatible with the current class
the implementors should attempt to reinitialize (retaining state). To affect
a complete policy reset oldInstance should be null.policyContext
- the current contextoldInstance
- the existing (possibly null) instance.FederationAMRMProxyPolicy
.FederationPolicyInitializationException
- if the initialization
cannot be completed properly. The oldInstance should be still
valid in case of failed initialization.FederationRouterPolicy getRouterPolicy(FederationPolicyInitializationContext policyContext, FederationRouterPolicy oldInstance) throws FederationPolicyInitializationException
FederationRouterPolicy
reinitialized with the current
context, otherwise a new instance initialized with the current context is
provided. If the instance is compatible with the current class the
implementors should attempt to reinitialize (retaining state). To affect a
complete policy reset oldInstance should be set to null.policyContext
- the current contextoldInstance
- the existing (possibly null) instance.FederationRouterPolicy
.FederationPolicyInitializationException
- if the initialization cannot
be completed properly. The oldInstance should be still valid in
case of failed initialization.SubClusterPolicyConfiguration serializeConf() throws FederationPolicyInitializationException
SubClusterPolicyConfiguration
.
This is to be used when writing a policy object in the federation policy
store.FederationPolicyInitializationException
- if the current state cannot
be serialized properlyString getQueue()
void setQueue(String queue)
queue
- the name of the queue.WeightedPolicyInfo getWeightedPolicyInfo()
void setWeightedPolicyInfo(WeightedPolicyInfo weightedPolicyInfo)
weightedPolicyInfo
- weightedPolicyInfo of the subCluster.boolean isSupportWeightedPolicyInfo()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.