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 propertly inizialized 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. |
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.
|
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 reinitalize (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 reinitalize (retaining state). To affect a
complete policy reset oldInstance shoulb be set to null.policyContext
- the current contextoldInstance
- the existing (possibly null) instance.FederationRouterPolicy
.FederationPolicyInitializationException
- if the initalization 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.Copyright © 2020 Apache Software Foundation. All rights reserved.