Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-14714 8d8c1a551 -> cbaa88d2b


AMBARI-22209. HdpCoreMpack: Quick Links should show NN web UI 
links.(vbrodetskyi)


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

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: cbaa88d2bdcc3ee3c3f043098f2b7a98f3563746
Parents: 8d8c1a5
Author: Vitaly Brodetskyi <vbrodets...@hortonworks.com>
Authored: Thu Oct 12 23:48:20 2017 +0300
Committer: Vitaly Brodetskyi <vbrodets...@hortonworks.com>
Committed: Thu Oct 12 23:48:20 2017 +0300

----------------------------------------------------------------------
 .../apache/ambari/server/state/ServiceInfo.java | 28 +++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cbaa88d2/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index 1cad4df..0e6e3c3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -468,9 +468,11 @@ public class ServiceInfo implements Validable, Cloneable {
     clone.serviceOsSpecifics =  serviceOsSpecifics;
     clone.configDir = configDir;
     clone.themesDir = themesDir;
-    clone.setThemes(themes);
+    clone.setThemes(getThemes());
+    clone.setThemesMap(themesMap);
     clone.setQuickLinksConfigurationsDir(quickLinksConfigurationsDir);
-    clone.setQuickLinksConfigurations(quickLinksConfigurations);
+    clone.setQuickLinksConfigurations(getQuickLinksConfigurations());
+    clone.setQuickLinksConfigurationsMap(quickLinksConfigurationsMap);
     clone.setCommandScript(commandScript);
     clone.setRequiredServices(requiredServices);
     return clone;
@@ -1029,8 +1031,17 @@ public class ServiceInfo implements Validable, Cloneable 
{
     this.themesDir = themesDir;
   }
 
+  /*
+  * This method will return data from themesMap if themes are not available.
+  * ThemesMap contain merged themes from all previous stacks.
+  * TODO we should think and fix it for HDP 3.0 because there we don't need 
merged data.
+  * */
   public List<ThemeInfo> getThemes() {
-    return themes;
+    List<ThemeInfo> themeList = themes;
+    if (themes == null & themesMap != null) {
+      themeList = new ArrayList<>(themesMap.values());
+    }
+    return themeList;
   }
 
   public void setThemes(List<ThemeInfo> themes) {
@@ -1063,8 +1074,17 @@ public class ServiceInfo implements Validable, Cloneable 
{
     this.quickLinksConfigurationsDir = quickLinksConfigurationsDir;
   }
 
+  /*
+  * This method will return data from quickLinksConfigurationsMap if 
quickLinksConfigurations are not available.
+  * quickLinksConfigurationsMap contain merged quickLinksConfigurations from 
all previous stacks.
+  * TODO we should think and fix it for HDP 3.0 because there we don't need 
merged data.
+  * */
   public List<QuickLinksConfigurationInfo> getQuickLinksConfigurations() {
-    return quickLinksConfigurations;
+    List<QuickLinksConfigurationInfo> quickLinksConigurationList = 
quickLinksConfigurations;
+    if (quickLinksConfigurations == null && quickLinksConfigurationsMap != 
null) {
+      quickLinksConigurationList = new 
ArrayList<>(quickLinksConfigurationsMap.values());
+    }
+    return quickLinksConigurationList;
   }
 
   public void setQuickLinksConfigurations(List<QuickLinksConfigurationInfo> 
quickLinksConfigurations) {

Reply via email to