ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [1/2] git commit: AMBARI-8048. Difference between core-site.xml, oozie-site.xml, hive-site.xml, hbase-site.xml from host and from UI (dlysnichenko)
Date Thu, 30 Oct 2014 19:08:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 c8961e6e6 -> e186f1ea2
  refs/heads/trunk b2aec15e8 -> 9e3d0c1b3


AMBARI-8048. Difference between core-site.xml, oozie-site.xml, hive-site.xml, hbase-site.xml
from host and from UI (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e186f1ea
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e186f1ea
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e186f1ea

Branch: refs/heads/branch-1.7.0
Commit: e186f1ea224770728f34de57b94bcad0c2e61ed1
Parents: c8961e6
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Thu Oct 30 21:05:52 2014 +0200
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Thu Oct 30 21:07:46 2014 +0200

----------------------------------------------------------------------
 .../controller/internal/ClientConfigResourceProvider.java    | 8 ++++++--
 .../internal/ClientConfigResourceProviderTest.java           | 8 +++++---
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e186f1ea/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index a4d3fea..339ebc4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -156,10 +156,14 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
       Map<String, Map<String, String>> configurations = new TreeMap<String,
Map<String, String>>();
       Map<String, Map<String, Map<String, String>>> configurationAttributes
= new TreeMap<String, Map<String, Map<String, String>>>();
 
-      Collection<Config> clusterConfigs = cluster.getAllConfigs();
+      Map<String, DesiredConfig> desiredClusterConfigs = cluster.getDesiredConfigs();
 
       //Get configurations and configuration attributes
-      for (Config clusterConfig : clusterConfigs) {
+      for (Map.Entry<String, DesiredConfig> desiredConfigEntry : desiredClusterConfigs.entrySet())
{
+
+        String configType = desiredConfigEntry.getKey();
+        DesiredConfig desiredConfig = desiredConfigEntry.getValue();
+        Config clusterConfig = cluster.getConfig(configType, desiredConfig.getTag());
 
         if (clusterConfig != null) {
           Map<String, String> props = new HashMap<String, String>(clusterConfig.getProperties());

http://git-wip-us.apache.org/repos/asf/ambari/blob/e186f1ea/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
index 4d7afb3..f0f278b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
@@ -141,6 +141,7 @@ public class ClientConfigResourceProviderTest {
     ServiceInfo serviceInfo = createNiceMock(ServiceInfo.class);
     CommandScriptDefinition commandScriptDefinition = createNiceMock(CommandScriptDefinition.class);
     Config clusterConfig = createNiceMock(Config.class);
+    DesiredConfig desiredConfig = createNiceMock(DesiredConfig.class);
     Host host = createNiceMock(Host.class);
     Service service = createNiceMock(Service.class);
     ServiceComponent serviceComponent = createNiceMock(ServiceComponent.class);
@@ -153,8 +154,8 @@ public class ClientConfigResourceProviderTest {
     Runtime runtime = createMock(Runtime.class);
     Process process = createNiceMock(Process.class);
 
-    Collection<Config> clusterConfigs = new HashSet<Config>();
-    clusterConfigs.add(clusterConfig);
+    Map<String, DesiredConfig> desiredConfigMap = new HashMap<String, DesiredConfig>();
+    desiredConfigMap.put("hive-site", desiredConfig);
     Map<String, Map<String, String>> allConfigTags = new HashMap<String, Map<String,
String>>();
     Map<String, Map<String, String>> properties = new HashMap<String, Map<String,
String>>();
     Map<String, Map<String, String>> configTags = new HashMap<String,
@@ -260,7 +261,8 @@ public class ClientConfigResourceProviderTest {
     expect(componentInfo.getCommandScript()).andReturn(commandScriptDefinition);
     expect(componentInfo.getClientConfigFiles()).andReturn(clientConfigFileDefinitionList);
     expect(ambariMetaInfo.getStackRoot()).andReturn(new File(stackRoot));
-    expect(cluster.getAllConfigs()).andReturn(clusterConfigs);
+    expect(cluster.getConfig("hive-site", null)).andReturn(clusterConfig);
+    expect(cluster.getDesiredConfigs()).andReturn(desiredConfigMap);
     expect(clusters.getHostsForCluster(clusterName)).andReturn(hosts);
     expect(clusters.getHost(hostName)).andReturn(host);
 


Mime
View raw message