Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d6cebbd2a -> 083cd7fcb


AMBARI-18621. Service Summary screen does not show hostname in tooltip pop-up 
for all services. (jaimin)


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

Branch: refs/heads/branch-2.5
Commit: 083cd7fcb81119cf8ab181ee569ab3bc66f70cea
Parents: d6cebbd
Author: Jaimin Jetly <jai...@hortonworks.com>
Authored: Mon Oct 17 19:04:01 2016 -0700
Committer: Jaimin Jetly <jai...@hortonworks.com>
Committed: Mon Oct 17 19:07:12 2016 -0700

----------------------------------------------------------------------
 .../controller/ServiceComponentHostRequest.java | 10 ++++++++
 .../ServiceComponentHostResponse.java           | 19 +++++++++++++-
 .../internal/HostComponentResourceProvider.java |  9 +++++++
 .../server/state/ServiceComponentHost.java      |  6 +++++
 .../svccomphost/ServiceComponentHostImpl.java   |  9 ++++++-
 .../src/main/resources/properties.json          |  1 +
 .../ClientConfigResourceProviderTest.java       |  6 +++--
 .../HostComponentResourceProviderTest.java      | 10 ++++----
 .../internal/HostResourceProviderTest.java      | 26 ++++++++++----------
 .../app/controllers/global/update_controller.js |  3 ++-
 .../app/mappers/component_config_mapper.js      |  1 +
 ambari-web/app/mappers/hosts_mapper.js          |  2 ++
 .../app/mappers/service_metrics_mapper.js       |  1 +
 ambari-web/app/models/host_component.js         |  1 +
 .../service/info/summary/master_components.hbs  |  2 +-
 15 files changed, 82 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java
index 4a07804..5b6c739 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java
@@ -26,6 +26,7 @@ public class ServiceComponentHostRequest {
   private String serviceName;
   private String componentName;
   private String hostname;
+  private String publicHostname;
   private String state;
   private String desiredState; // CREATE/UPDATE
   private String desiredStackId; // UPDATE
@@ -178,6 +179,7 @@ public class ServiceComponentHostRequest {
       .append(", serviceName=").append(serviceName)
       .append(", componentName=").append(componentName)
       .append(", hostname=").append(hostname)
+      .append(", publicHostname=").append(publicHostname)
       .append(", desiredState=").append(desiredState)
       .append(", state=").append(state)
       .append(", desiredStackId=").append(desiredStackId)
@@ -201,4 +203,12 @@ public class ServiceComponentHostRequest {
   public String getMaintenanceState() {
     return maintenanceState;
   }
+
+  public String getPublicHostname() {
+    return publicHostname;
+  }
+
+  public void setPublicHostname(String publicHostname) {
+    this.publicHostname = publicHostname;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
index 85b2b46..f6993f8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
@@ -30,6 +30,7 @@ public class ServiceComponentHostResponse {
   private String serviceName;
   private String componentName;
   private String displayName;
+  private String publicHostname;
   private String hostname;
   // type -> desired config
   private Map<String, HostConfig> actualConfigs;
@@ -44,7 +45,8 @@ public class ServiceComponentHostResponse {
 
 
   public ServiceComponentHostResponse(String clusterName, String serviceName,
-                                      String componentName, String 
displayName, String hostname,
+                                      String componentName, String displayName,
+                                      String hostname, String publicHostname,
                                       String liveState, String stackVersion,
                                       String desiredState, String 
desiredStackVersion,
                                       HostComponentAdminState adminState) {
@@ -53,6 +55,7 @@ public class ServiceComponentHostResponse {
     this.componentName = componentName;
     this.displayName = displayName;
     this.hostname = hostname;
+    this.publicHostname = publicHostname;
     this.liveState = liveState;
     this.stackVersion = stackVersion;
     this.desiredState = desiredState;
@@ -112,6 +115,20 @@ public class ServiceComponentHostResponse {
   }
 
   /**
+   * @return the public hostname
+   */
+  public String getPublicHostname() {
+    return publicHostname;
+  }
+
+  /**
+   * @param publicHostname the public hostname to set
+   */
+  public void setPublicHostname(String publicHostname) {
+    this.publicHostname = publicHostname;
+  }
+
+  /**
    * @return the liveState
    */
   public String getLiveState() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 4f279c8..87eb266 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -91,6 +91,8 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
       = PropertyHelper.getPropertyId("HostRoles", "display_name");
   public static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID
       = PropertyHelper.getPropertyId("HostRoles", "host_name");
+  public static final String HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID
+      = PropertyHelper.getPropertyId("HostRoles", "public_host_name");
   public static final String HOST_COMPONENT_STATE_PROPERTY_ID
       = PropertyHelper.getPropertyId("HostRoles", "state");
   public static final String HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID
@@ -229,6 +231,8 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
               response.getDisplayName(), requestedIds);
       setResourceProperty(resource, HOST_COMPONENT_HOST_NAME_PROPERTY_ID,
               response.getHostname(), requestedIds);
+      setResourceProperty(resource, 
HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID,
+          response.getPublicHostname(), requestedIds);
       setResourceProperty(resource, HOST_COMPONENT_STATE_PROPERTY_ID,
               response.getLiveState(), requestedIds);
       setResourceProperty(resource, HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID,
@@ -690,6 +694,11 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
       serviceComponentHostRequest.setAdminState(
           
properties.get(HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID).toString());
     }
+    if (properties.get(HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID) != null) {
+      serviceComponentHostRequest.setPublicHostname(
+          
properties.get(HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID).toString());
+    }
+
 
     Object o = properties.get(HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID);
     if (null != o) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
index 586134c..cd7f826 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
@@ -60,6 +60,12 @@ public interface ServiceComponentHost {
   String getHostName();
 
   /**
+   * Get the public host name this object maps to
+   * @return Host's public hostname
+   */
+  String getPublicHostName();
+
+  /**
    * Get the Host this object maps to
    * @return Host Object
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index 3b5ed28..74eaa62 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -1092,6 +1092,11 @@ public class ServiceComponentHostImpl implements 
ServiceComponentHost {
   }
 
   @Override
+  public String getPublicHostName() {
+    return host.getPublicHostName();
+  }
+
+  @Override
   public Host getHost() {
     return host;
   }
@@ -1364,6 +1369,7 @@ public class ServiceComponentHostImpl implements 
ServiceComponentHost {
         String serviceName = serviceComponent.getServiceName();
         String serviceComponentName = serviceComponent.getName();
         String hostName = getHostName();
+        String publicHostName = getPublicHostName();
         String state = getState().toString();
         String stackId = getStackVersion().getStackId();
         String desiredState = getDesiredState().toString();
@@ -1382,7 +1388,8 @@ public class ServiceComponentHostImpl implements 
ServiceComponentHost {
 
         ServiceComponentHostResponse r = new ServiceComponentHostResponse(
             clusterName, serviceName,
-            serviceComponentName, displayName, hostName, state,
+            serviceComponentName, displayName, hostName,
+            publicHostName, state,
             stackId, desiredState,
             desiredStackId, componentAdminState);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json 
b/ambari-server/src/main/resources/properties.json
index 30d83bd..34d4641 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -74,6 +74,7 @@
         "HostRoles/role_id",
         "HostRoles/cluster_name",
         "HostRoles/host_name",
+        "HostRoles/public_host_name",
         "HostRoles/component_name",
         "HostRoles/display_name",
         "HostRoles/state",

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/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 5359f69..4be5013 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
@@ -225,6 +225,7 @@ public class ClientConfigResourceProviderTest {
     String componentName = "PIG";
     String displayName = "Pig Client";
     String hostName = "Host100";
+    String publicHostname = "Host100";
     String desiredState = "INSTALLED";
 
     String stackName = "S1";
@@ -249,7 +250,7 @@ public class ClientConfigResourceProviderTest {
     HashMap<String, ServiceOsSpecific> serviceOsSpecificHashMap = new 
HashMap<String, ServiceOsSpecific>();
     serviceOsSpecificHashMap.put("key",serviceOsSpecific);
 
-    ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse(clusterName, serviceName, componentName, 
displayName, hostName, desiredState, "", null, null, null);
+    ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse(clusterName, serviceName, componentName, 
displayName, hostName, publicHostname,desiredState, "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -425,6 +426,7 @@ public class ClientConfigResourceProviderTest {
     String componentName = "PIG";
     String displayName = "Pig Client";
     String hostName = "Host100";
+    String publicHostName = "Host100";
     String desiredState = "INSTALLED";
 
     String stackName = "S1";
@@ -450,7 +452,7 @@ public class ClientConfigResourceProviderTest {
     HashMap<String, ServiceOsSpecific> serviceOsSpecificHashMap = new 
HashMap<String, ServiceOsSpecific>();
     serviceOsSpecificHashMap.put("key",serviceOsSpecific);
 
-    ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse(clusterName, serviceName, componentName, 
displayName, hostName, desiredState, "", null, null, null);
+    ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse(clusterName, serviceName, componentName, 
displayName, hostName, publicHostName, desiredState, "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
index 5dc69e9..ec9da09 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
@@ -184,14 +184,14 @@ public class HostComponentResourceProviderTest {
     StackId stackId = new StackId("HDP-0.1");
     StackId stackId2 = new StackId("HDP-0.2");
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component100", "Component 100", 
"Host100", State.INSTALLED.toString(), stackId.getStackId(), 
State.STARTED.toString(),
+        "Cluster100", "Service100", "Component100", "Component 100", 
"Host100", "Host100", State.INSTALLED.toString(), stackId.getStackId(), 
State.STARTED.toString(),
         stackId2.getStackId(), null));
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component101", "Component 101", 
"Host100", State.INSTALLED.toString(), stackId.getStackId(), 
State.STARTED.toString(),
+        "Cluster100", "Service100", "Component101", "Component 101", 
"Host100", "Host100", State.INSTALLED.toString(), stackId.getStackId(), 
State.STARTED.toString(),
         stackId2.getStackId(), null));
 
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component102", "Component 102", 
"Host100", State.INSTALLED.toString(), stackId.getStackId(), 
State.STARTED.toString(),
+        "Cluster100", "Service100", "Component102", "Component 102", 
"Host100","Host100", State.INSTALLED.toString(), stackId.getStackId(), 
State.STARTED.toString(),
         stackId2.getStackId(), null));
     Map<String, String> expectedNameValues = new HashMap<String, String>();
     expectedNameValues.put(
@@ -337,7 +337,7 @@ public class HostComponentResourceProviderTest {
 
     Set<ServiceComponentHostResponse> nameResponse = new 
HashSet<ServiceComponentHostResponse>();
     nameResponse.add(new ServiceComponentHostResponse(
-        "Cluster102", "Service100", "Component100", "Component 100", 
"Host100", "INSTALLED", "", "", "", null));
+        "Cluster102", "Service100", "Component100", "Component 100", 
"Host100", "Host100","INSTALLED", "", "", "", null));
 
     // set expectations
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();
@@ -538,7 +538,7 @@ public class HostComponentResourceProviderTest {
 
     Set<ServiceComponentHostResponse> nameResponse = new 
HashSet<ServiceComponentHostResponse>();
     nameResponse.add(new ServiceComponentHostResponse(
-        "Cluster102", "Service100", "Component100", "Component 100", 
"Host100", "INSTALLED", "", "", "", null));
+        "Cluster102", "Service100", "Component100", "Component 100", 
"Host100", "Host100","INSTALLED", "", "", "", null));
 
     // set expectations
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
index 518d5ed..c71b054 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
@@ -300,11 +300,11 @@ public class HostResourceProviderTest extends 
EasyMockSupport {
     clusterSet.add(cluster);
 
     ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component100", 
"Component 100",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
     ServiceComponentHostResponse shr2 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component102", 
"Component 102",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
     ServiceComponentHostResponse shr3 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component103", 
"Component 103",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -401,11 +401,11 @@ public class HostResourceProviderTest extends 
EasyMockSupport {
     clusterSet.add(cluster);
 
     ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component100", 
"Component 100",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
     ServiceComponentHostResponse shr2 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component102", 
"Component 102",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
     ServiceComponentHostResponse shr3 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component103", 
"Component 103",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -497,11 +497,11 @@ public class HostResourceProviderTest extends 
EasyMockSupport {
     clusterSet.add(cluster);
 
     ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component100", 
"Component 100",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
     ServiceComponentHostResponse shr2 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component102", 
"Component 102",
-        "Host100", "INSTALLED", "", null, null, null);
+        "Host100", "Host100", "INSTALLED", "", null, null, null);
     ServiceComponentHostResponse shr3 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component103", 
"Component 103",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -697,7 +697,7 @@ public class HostResourceProviderTest extends 
EasyMockSupport {
     clusterSet.add(cluster);
 
     ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component100", 
"Component 100",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -784,11 +784,11 @@ public class HostResourceProviderTest extends 
EasyMockSupport {
     clusterSet.add(cluster);
 
     ServiceComponentHostResponse shr1 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component100", 
"Component 100",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
     ServiceComponentHostResponse shr2 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component102", 
"Component 102",
-        "Host100", "INSTALLED", "", null, null, null);
+        "Host100", "Host100", "INSTALLED", "", null, null, null);
     ServiceComponentHostResponse shr3 = new 
ServiceComponentHostResponse("Cluster100", "Service100", "Component103", 
"Component 103",
-        "Host100", "STARTED", "", null, null, null);
+        "Host100", "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new 
HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js 
b/ambari-web/app/controllers/global/update_controller.js
index 68e6ba3..da10e00 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -466,6 +466,7 @@ App.UpdateController = Em.Controller.extend({
         'ServiceComponentInfo/service_name,' +
         'host_components/HostRoles/display_name,' +
         'host_components/HostRoles/host_name,' +
+        'host_components/HostRoles/public_host_name,' +
         'host_components/HostRoles/state,' +
         'host_components/HostRoles/maintenance_state,' +
         'host_components/HostRoles/stale_configs,' +
@@ -533,7 +534,7 @@ App.UpdateController = Em.Controller.extend({
   },
   updateComponentConfig: function (callback) {
     var testUrl = '/data/services/host_component_stale_configs.json';
-    var componentConfigUrl = this.getUrl(testUrl, 
'/components?host_components/HostRoles/stale_configs=true&fields=host_components/HostRoles/display_name,host_components/HostRoles/service_name,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,host_components/HostRoles/host_name,host_components/HostRoles/stale_configs,host_components/HostRoles/desired_admin_state&minimal_response=true');
+    var componentConfigUrl = this.getUrl(testUrl, 
'/components?host_components/HostRoles/stale_configs=true&fields=host_components/HostRoles/display_name,host_components/HostRoles/service_name,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,host_components/HostRoles/host_name,host_components/HostRoles/public_host_name,host_components/HostRoles/stale_configs,host_components/HostRoles/desired_admin_state&minimal_response=true');
     App.HttpClient.get(componentConfigUrl, App.componentConfigMapper, {
       complete: callback
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-web/app/mappers/component_config_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/component_config_mapper.js 
b/ambari-web/app/mappers/component_config_mapper.js
index 860730e..866f811 100644
--- a/ambari-web/app/mappers/component_config_mapper.js
+++ b/ambari-web/app/mappers/component_config_mapper.js
@@ -26,6 +26,7 @@ App.componentConfigMapper = App.QuickDataMapper.create({
     component_name: 'HostRoles.component_name',
     display_name: 'HostRoles.display_name',
     host_name: 'HostRoles.host_name',
+    public_host_name: 'HostRoles.public_host_name',
     $ha_status: '',
     $display_name_advanced: '',
     stale_configs: 'HostRoles.stale_configs',

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js 
b/ambari-web/app/mappers/hosts_mapper.js
index 6850242..3c7dd70 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -65,6 +65,7 @@ App.hostsMapper = App.QuickDataMapper.create({
     work_status: 'HostRoles.state',
     stale_configs: 'HostRoles.stale_configs',
     host_name: 'host_name',
+    public_host_name: 'public_host_name',
     admin_state: 'HostRoles.desired_admin_state'
   },
   stackVersionConfig: {
@@ -131,6 +132,7 @@ App.hostsMapper = App.QuickDataMapper.create({
           component.id = id;
           component.host_id = item.Hosts.host_name;
           component.host_name = item.Hosts.host_name;
+          component.public_host_name = item.Hosts.public_host_name;
           components.push(component);
           componentsIdMap[id] = component;
           if (!newHostComponentsMap[serviceName]) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index bf4fc91..c4f37df 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -159,6 +159,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     component_name: 'HostRoles.component_name',
     host_id: 'HostRoles.host_name',
     host_name: 'HostRoles.host_name',
+    public_host_name: 'HostRoles.public_host_name',
     stale_configs: 'HostRoles.stale_configs',
     ha_status: 'HostRoles.ha_state',
     display_name_advanced: 'display_name_advanced',

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js 
b/ambari-web/app/models/host_component.js
index dca7ff0..c6b8264 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -29,6 +29,7 @@ App.HostComponent = DS.Model.extend({
   host: DS.belongsTo('App.Host'),
   componentLogs: DS.belongsTo('App.HostComponentLog'),
   hostName: DS.attr('string'),
+  publicHostName: DS.attr('string'),
   service: DS.belongsTo('App.Service'),
   adminState: DS.attr('string'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/083cd7fc/ambari-web/app/templates/main/service/info/summary/master_components.hbs
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/templates/main/service/info/summary/master_components.hbs 
b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
index 460b048..8da6f5a 100644
--- a/ambari-web/app/templates/main/service/info/summary/master_components.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
@@ -19,7 +19,7 @@
 {{#each comp in view.mastersComp}}
   <tr {{bindAttr class="comp.isSubComponent:component-small :component 
comp.componentName"}}>
     <td {{bindAttr class=":summary-label comp.summaryLabelClassName"}}>
-      <a href="#" {{action showDetails comp.host}} title="{{unbound 
comp.host.publicHostName}}" rel="UsageTooltip">
+      <a href="#" {{action showDetails comp.host}} title="{{unbound 
comp.publicHostName}}" rel="UsageTooltip">
         {{#if comp.displayNameAdvanced}}
           {{comp.displayNameAdvanced}}
         {{else}}

Reply via email to