public class GPGPolicyFacade extends Object
getPolicyManager(String)
Gets the PolicyManager via queue name. Null if there is no policy
configured for the specified queue. The PolicyManager can be used to
extract the FederationRouterPolicy
and
FederationAMRMProxyPolicy
, as well as any policy specific parameters
setPolicyManager(FederationPolicyManager)
Sets the PolicyManager. If the policy configuration is the same, no change
occurs. Otherwise, the internal cache is updated and the new configuration
is written into the FederationStateStore
This class assumes that the GPG is the only service
writing policies. Thus, the only FederationStateStore reads occur the first
time a queue policy is retrieved - after that, the GPG only writes to the
FederationStateStore.
The class uses a PolicyManager cache and a SubClusterPolicyConfiguration
cache. The primary use for these caches are to serve reads, and to
identify when the PolicyGenerator has actually changed the policy
so unnecessary FederationStateStore policy writes can be avoided.Constructor and Description |
---|
GPGPolicyFacade(org.apache.hadoop.yarn.server.federation.utils.FederationStateStoreFacade stateStore,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager |
getPolicyManager(String queueName)
Provides a utility for the policy generator to read the policy manager
from the FederationStateStore.
|
void |
setPolicyManager(org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager policyManager)
Provides a utility for the policy generator to write a policy manager
into the FederationStateStore.
|
public GPGPolicyFacade(org.apache.hadoop.yarn.server.federation.utils.FederationStateStoreFacade stateStore, org.apache.hadoop.conf.Configuration conf)
public org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager getPolicyManager(String queueName) throws org.apache.hadoop.yarn.exceptions.YarnException
queueName
- the name of the queue we want the policy manager for.org.apache.hadoop.yarn.exceptions.YarnException
- exceptions from yarn servers.public void setPolicyManager(org.apache.hadoop.yarn.server.federation.policies.manager.FederationPolicyManager policyManager) throws org.apache.hadoop.yarn.exceptions.YarnException
policyManager
- The policy manager we want to update into the state
store. It contains policy information as well as
the queue name we will update for.org.apache.hadoop.yarn.exceptions.YarnException
- exceptions from yarn servers.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.