public class ConfigHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER_DEFAULT_TAG |
Constructor and Description |
---|
ConfigHelper(Clusters c,
AmbariMetaInfo metaInfo) |
Modifier and Type | Method and Description |
---|---|
void |
applyCustomConfig(Map<String,Map<String,String>> configurations,
String type,
String name,
String value,
Boolean deleted) |
Map<String,Map<String,String>> |
getEffectiveConfigProperties(Cluster cluster,
Map<String,Map<String,String>> desiredTags)
Get all config properties for a cluster given a set of configType to
versionTags map.
|
Map<String,Map<String,String>> |
getEffectiveDesiredTags(Cluster cluster,
String hostName)
Gets the desired tags for a cluster and host
|
Map<String,String> |
getMergedConfig(Map<String,String> persistedClusterConfig,
Map<String,String> override)
Merge override with original, if original property doesn't exist,
add it to the properties
|
boolean |
isStaleConfigs(ServiceComponentHost sch)
The purpose of this method is to determine if a
ServiceComponentHost 's
known actual configs are different than what is set on the cluster (the desired). |
public static final String CLUSTER_DEFAULT_TAG
@Inject public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo)
public Map<String,Map<String,String>> getEffectiveDesiredTags(Cluster cluster, String hostName) throws AmbariException
cluster
- the clusterhostName
- the host nameAmbariException
public Map<String,Map<String,String>> getEffectiveConfigProperties(Cluster cluster, Map<String,Map<String,String>> desiredTags)
cluster
- desiredTags
- public Map<String,String> getMergedConfig(Map<String,String> persistedClusterConfig, Map<String,String> override)
persistedClusterConfig
- override
- public void applyCustomConfig(Map<String,Map<String,String>> configurations, String type, String name, String value, Boolean deleted)
public boolean isStaleConfigs(ServiceComponentHost sch) throws AmbariException
ServiceComponentHost
's
known actual configs are different than what is set on the cluster (the desired).
The following logic is applied:
false
true
if the config key is on the stack.
otherwise false
false
true
if the changed keys
exist on the stack, otherwise false
@ServiceComponentHost
- true
if the actual configs are staleAmbariException
Copyright © 2015. All rights reserved.