ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnettle...@apache.org
Subject ambari git commit: AMBARI-14830. Clients names different on host details page and filter. (Daniel Gergely via rnettleton)
Date Wed, 24 Feb 2016 18:48:01 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b988562aa -> b81db70e5


AMBARI-14830. Clients names different on host details page and filter. (Daniel Gergely via
rnettleton)


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

Branch: refs/heads/trunk
Commit: b81db70e5bdfdcb6b82274ccce84fb051eeae180
Parents: b988562
Author: Bob Nettleton <rnettleton@hortonworks.com>
Authored: Wed Feb 24 13:47:11 2016 -0500
Committer: Bob Nettleton <rnettleton@hortonworks.com>
Committed: Wed Feb 24 13:47:40 2016 -0500

----------------------------------------------------------------------
 .../ServiceComponentHostResponse.java           | 11 ++++++++-
 .../controller/ServiceComponentResponse.java    | 13 +++++++++-
 .../internal/ComponentResourceProvider.java     |  2 ++
 .../internal/HostComponentResourceProvider.java |  4 +++
 .../server/state/ServiceComponentImpl.java      |  5 +++-
 .../svccomphost/ServiceComponentHostImpl.java   | 12 ++++++++-
 .../MAHOUT/1.0.0.2.3/metainfo.xml               |  2 +-
 .../common-services/PIG/0.12.0.2.0/metainfo.xml |  2 +-
 .../SLIDER/0.60.0.2.2/metainfo.xml              |  2 +-
 .../SQOOP/1.4.4.2.0/metainfo.xml                |  2 +-
 .../src/main/resources/properties.json          |  2 ++
 .../ClientConfigResourceProviderTest.java       |  6 +++--
 .../internal/ComponentResourceProviderTest.java | 12 ++++-----
 .../HostComponentResourceProviderTest.java      |  8 +++---
 .../internal/HostResourceProviderTest.java      | 26 ++++++++++----------
 .../app/controllers/global/update_controller.js |  4 +--
 .../app/mappers/components_state_mapper.js      |  1 +
 ambari-web/app/mappers/hosts_mapper.js          |  1 +
 ambari-web/app/models/client_component.js       |  9 +------
 ambari-web/app/models/host_component.js         |  7 +-----
 ambari-web/test/models/host_component_test.js   | 17 -------------
 21 files changed, 82 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 c25c970..85b2b46 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
@@ -29,6 +29,7 @@ public class ServiceComponentHostResponse {
   private String clusterName; // REF
   private String serviceName;
   private String componentName;
+  private String displayName;
   private String hostname;
   // type -> desired config
   private Map<String, HostConfig> actualConfigs;
@@ -43,13 +44,14 @@ public class ServiceComponentHostResponse {
 
 
   public ServiceComponentHostResponse(String clusterName, String serviceName,
-                                      String componentName, String hostname,
+                                      String componentName, String displayName, String hostname,
                                       String liveState, String stackVersion,
                                       String desiredState, String desiredStackVersion,
                                       HostComponentAdminState adminState) {
     this.clusterName = clusterName;
     this.serviceName = serviceName;
     this.componentName = componentName;
+    this.displayName = displayName;
     this.hostname = hostname;
     this.liveState = liveState;
     this.stackVersion = stackVersion;
@@ -89,6 +91,13 @@ public class ServiceComponentHostResponse {
   }
 
   /**
+   * @return the displayName
+   */
+  public String getDisplayName() {
+    return displayName;
+  }
+
+  /**
    * @return the hostname
    */
   public String getHostname() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java
index 381b114..cb84b89 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentResponse.java
@@ -29,6 +29,8 @@ public class ServiceComponentResponse {
 
   private String componentName;
 
+  private String displayName;
+
   private String desiredStackVersion;
 
   private String desiredState;
@@ -51,12 +53,14 @@ public class ServiceComponentResponse {
                                   int totalCount,
                                   int startedCount,
                                   int installedCount,
-                                  boolean recoveryEnabled) {
+                                  boolean recoveryEnabled,
+                                  String displayName) {
     super();
     this.clusterId = clusterId;
     this.clusterName = clusterName;
     this.serviceName = serviceName;
     this.componentName = componentName;
+    this.displayName = displayName;
     this.desiredStackVersion = desiredStackVersion;
     this.desiredState = desiredState;
     this.totalCount = totalCount;
@@ -94,6 +98,13 @@ public class ServiceComponentResponse {
   }
 
   /**
+   * @return the displayName
+   */
+  public String getDisplayName() {
+    return displayName;
+  }
+
+  /**
    * @return the clusterId
    */
   public Long getClusterId() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
index b339adf..0e97e1e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
@@ -79,6 +79,7 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
   protected static final String COMPONENT_CLUSTER_NAME_PROPERTY_ID    = "ServiceComponentInfo/cluster_name";
   protected static final String COMPONENT_SERVICE_NAME_PROPERTY_ID    = "ServiceComponentInfo/service_name";
   protected static final String COMPONENT_COMPONENT_NAME_PROPERTY_ID  = "ServiceComponentInfo/component_name";
+  protected static final String COMPONENT_DISPLAY_NAME_PROPERTY_ID    = "ServiceComponentInfo/display_name";
   protected static final String COMPONENT_STATE_PROPERTY_ID           = "ServiceComponentInfo/state";
   protected static final String COMPONENT_CATEGORY_PROPERTY_ID        = "ServiceComponentInfo/category";
   protected static final String COMPONENT_TOTAL_COUNT_PROPERTY_ID     = "ServiceComponentInfo/total_count";
@@ -174,6 +175,7 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
       setResourceProperty(resource, COMPONENT_CLUSTER_NAME_PROPERTY_ID, response.getClusterName(),
requestedIds);
       setResourceProperty(resource, COMPONENT_SERVICE_NAME_PROPERTY_ID, response.getServiceName(),
requestedIds);
       setResourceProperty(resource, COMPONENT_COMPONENT_NAME_PROPERTY_ID, response.getComponentName(),
requestedIds);
+      setResourceProperty(resource, COMPONENT_DISPLAY_NAME_PROPERTY_ID, response.getDisplayName(),
requestedIds);
       setResourceProperty(resource, COMPONENT_STATE_PROPERTY_ID, response.getDesiredState(),
requestedIds);
       setResourceProperty(resource, COMPONENT_CATEGORY_PROPERTY_ID, response.getCategory(),
requestedIds);
       setResourceProperty(resource, COMPONENT_TOTAL_COUNT_PROPERTY_ID, response.getTotalCount(),
requestedIds);

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 a2a58e8..3c33a23 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
@@ -87,6 +87,8 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
       = PropertyHelper.getPropertyId("HostRoles", "service_name");
   protected static final String HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID
       = PropertyHelper.getPropertyId("HostRoles", "component_name");
+  protected static final String HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID
+      = PropertyHelper.getPropertyId("HostRoles", "display_name");
   protected static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID
       = PropertyHelper.getPropertyId("HostRoles", "host_name");
   protected static final String HOST_COMPONENT_STATE_PROPERTY_ID
@@ -241,6 +243,8 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
               response.getServiceName(), requestedIds);
       setResourceProperty(resource, HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID,
               response.getComponentName(), requestedIds);
+      setResourceProperty(resource, HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID,
+              response.getDisplayName(), requestedIds);
       setResourceProperty(resource, HOST_COMPONENT_HOST_NAME_PROPERTY_ID,
               response.getHostname(), requestedIds);
       setResourceProperty(resource, HOST_COMPONENT_STATE_PROPERTY_ID,

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
index 197f4cd..4be1c21 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
@@ -59,6 +59,7 @@ public class ServiceComponentImpl implements ServiceComponent {
   private final ReadWriteLock clusterGlobalLock;
   private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
   private final String componentName;
+  private final String displayName;
   private final boolean isClientComponent;
   private final boolean isMasterComponent;
   private final boolean isVersionAdvertised;
@@ -108,6 +109,7 @@ public class ServiceComponentImpl implements ServiceComponent {
       isClientComponent = compInfo.isClient();
       isMasterComponent = compInfo.isMaster();
       isVersionAdvertised = compInfo.isVersionAdvertised();
+      displayName = compInfo.getDisplayName();
     } catch (ObjectNotFoundException e) {
       throw new RuntimeException("Trying to create a ServiceComponent"
           + " not recognized in stack info"
@@ -160,6 +162,7 @@ public class ServiceComponentImpl implements ServiceComponent {
       isClientComponent = compInfo.isClient();
       isMasterComponent = compInfo.isMaster();
       isVersionAdvertised = compInfo.isVersionAdvertised();
+      displayName = compInfo.getDisplayName();
     } catch (ObjectNotFoundException e) {
       throw new AmbariException("Trying to create a ServiceComponent"
           + " not recognized in stack info"
@@ -510,7 +513,7 @@ public class ServiceComponentImpl implements ServiceComponent {
           cluster.getClusterName(), service.getName(), getName(),
           getDesiredStackVersion().getStackId(), getDesiredState().toString(),
           getTotalCount(), getStartedCount(), getInstalledCount(),
-          isRecoveryEnabled());
+          isRecoveryEnabled(), displayName);
       return r;
     } finally {
       readWriteLock.readLock().unlock();

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 806eb6b..98dc1b7 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
@@ -54,6 +54,7 @@ import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
 import org.apache.ambari.server.orm.entities.StackEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.HostComponentAdminState;
@@ -1339,9 +1340,18 @@ public class ServiceComponentHostImpl implements ServiceComponentHost
{
         HostComponentAdminState componentAdminState = getComponentAdminState();
         UpgradeState upgradeState = hostComponentStateEntity.getUpgradeState();
 
+        String displayName = null;
+        try {
+          ComponentInfo compInfo = ambariMetaInfo.getComponent(getStackVersion().getStackName(),
+            getStackVersion().getStackVersion(), serviceName, serviceComponentName);
+          displayName = compInfo.getDisplayName();
+        } catch (AmbariException e) {
+          displayName = serviceComponentName;
+        }
+
         ServiceComponentHostResponse r = new ServiceComponentHostResponse(
             clusterName, serviceName,
-            serviceComponentName, hostName, state,
+            serviceComponentName, displayName, hostName, state,
             stackId, desiredState,
             desiredStackId, componentAdminState);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/metainfo.xml
b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/metainfo.xml
index bd8ef70..f363e55 100644
--- a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/metainfo.xml
@@ -30,7 +30,7 @@
       <components>
         <component>
           <name>MAHOUT</name>
-          <displayName>Mahout</displayName>
+          <displayName>Mahout Client</displayName>
           <category>CLIENT</category>
           <cardinality>0+</cardinality>
           <versionAdvertised>true</versionAdvertised>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/metainfo.xml
b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/metainfo.xml
index 27a9c35..d445e58 100644
--- a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/metainfo.xml
@@ -26,7 +26,7 @@
       <components>
         <component>
           <name>PIG</name>
-          <displayName>Pig</displayName>
+          <displayName>Pig Client</displayName>
           <category>CLIENT</category>
           <cardinality>0+</cardinality>
           <versionAdvertised>true</versionAdvertised>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
index a2002f1..f1552e0 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
@@ -26,7 +26,7 @@
       <components>
         <component>
           <name>SLIDER</name>
-          <displayName>Slider</displayName>
+          <displayName>Slider Client</displayName>
           <category>CLIENT</category>
           <cardinality>0+</cardinality>
           <versionAdvertised>true</versionAdvertised>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
index 2c9d881..83d0934 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
@@ -29,7 +29,7 @@
       <components>
         <component>
           <name>SQOOP</name>
-          <displayName>Sqoop</displayName>
+          <displayName>Sqoop Client</displayName>
           <category>CLIENT</category>
           <cardinality>1+</cardinality>
           <versionAdvertised>true</versionAdvertised>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 8ccae05..0fc9766 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -55,6 +55,7 @@
         "ServiceComponentInfo/service_name",
         "ServiceComponentInfo/component_name",
         "ServiceComponentInfo/cluster_name",
+        "ServiceComponentInfo/display_name",
         "ServiceComponentInfo/state",
         "ServiceComponents/display_name",
         "ServiceComponents/description",
@@ -71,6 +72,7 @@
         "HostRoles/cluster_name",
         "HostRoles/host_name",
         "HostRoles/component_name",
+        "HostRoles/display_name",
         "HostRoles/state",
         "HostRoles/desired_state",
         "HostRoles/stack_id",

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 7643abb..3e4978a 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
@@ -190,6 +190,7 @@ public class ClientConfigResourceProviderTest {
     String clusterName = "C1";
     String serviceName = "PIG";
     String componentName = "PIG";
+    String displayName = "Pig Client";
     String hostName = "Host100";
     String desiredState = "INSTALLED";
 
@@ -215,7 +216,7 @@ public class ClientConfigResourceProviderTest {
     HashMap<String, ServiceOsSpecific> serviceOsSpecificHashMap = new HashMap<String,
ServiceOsSpecific>();
     serviceOsSpecificHashMap.put("key",serviceOsSpecific);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(clusterName, serviceName,
componentName, hostName, desiredState, "", null, null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(clusterName, serviceName,
componentName, displayName, hostName, desiredState, "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -388,6 +389,7 @@ public class ClientConfigResourceProviderTest {
     String clusterName = "C1";
     String serviceName = "PIG";
     String componentName = "PIG";
+    String displayName = "Pig Client";
     String hostName = "Host100";
     String desiredState = "INSTALLED";
 
@@ -414,7 +416,7 @@ public class ClientConfigResourceProviderTest {
     HashMap<String, ServiceOsSpecific> serviceOsSpecificHashMap = new HashMap<String,
ServiceOsSpecific>();
     serviceOsSpecificHashMap.put("key",serviceOsSpecific);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(clusterName, serviceName,
componentName, hostName, desiredState, "", null, null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(clusterName, serviceName,
componentName, displayName, hostName, desiredState, "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
index d24ca09..c624cfd 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
@@ -226,13 +226,13 @@ public class ComponentResourceProviderTest {
 
     expect(serviceComponent1.convertToResponse()).andReturn(
       new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", null,
"", 1, 1, 0,
-              true /* recovery enabled */));
+              true /* recovery enabled */, "Component100 Client"));
     expect(serviceComponent2.convertToResponse()).andReturn(
       new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null,
"", 1, 1, 0,
-              false /* recovery not enabled */));
+              false /* recovery not enabled */, "Component101 Client"));
     expect(serviceComponent3.convertToResponse()).andReturn(
       new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null,
"", 1, 1, 0,
-              true /* recovery enabled */));
+              true /* recovery enabled */, "Component102 Client"));
 
     expect(ambariMetaInfo.getComponent((String) anyObject(),
         (String) anyObject(), (String) anyObject(), (String) anyObject()))
@@ -371,13 +371,13 @@ public class ComponentResourceProviderTest {
 
     expect(serviceComponent1.convertToResponse()).andReturn(
       new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null,
"", 1, 0, 1,
-              false /* recovery not enabled */));
+              false /* recovery not enabled */, "Component101 Client"));
     expect(serviceComponent2.convertToResponse()).andReturn(
       new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null,
"", 1, 0, 1,
-              false /* recovery not enabled */));
+              false /* recovery not enabled */, "Component102 Client"));
     expect(serviceComponent3.convertToResponse()).andReturn(
       new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component103", null,
"", 1, 0, 1,
-              false /* recovery not enabled */));
+              false /* recovery not enabled */, "Component103 Client"));
     expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
     expect(serviceComponent2.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
     expect(serviceComponent3.getDesiredState()).andReturn(State.INSTALLED).anyTimes();

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 f9c1fe4..a2e1fda 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
@@ -182,14 +182,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", "Host100", State.INSTALLED.toString(),
stackId.getStackId(), State.STARTED.toString(),
+        "Cluster100", "Service100", "Component100", "Component 100", "Host100", State.INSTALLED.toString(),
stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId(), null));
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component101", "Host100", State.INSTALLED.toString(),
stackId.getStackId(), State.STARTED.toString(),
+        "Cluster100", "Service100", "Component101", "Component 101", "Host100", State.INSTALLED.toString(),
stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId(), null));
 
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component102", "Host100", State.INSTALLED.toString(),
stackId.getStackId(), State.STARTED.toString(),
+        "Cluster100", "Service100", "Component102", "Component 102", "Host100", State.INSTALLED.toString(),
stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId(), null));
     Map<String, String> expectedNameValues = new HashMap<String, String>();
     expectedNameValues.put(
@@ -335,7 +335,7 @@ public class HostComponentResourceProviderTest {
 
     Set<ServiceComponentHostResponse> nameResponse = new HashSet<ServiceComponentHostResponse>();
     nameResponse.add(new ServiceComponentHostResponse(
-        "Cluster102", "Service100", "Component100", "Host100", "INSTALLED", "", "", "", null));
+        "Cluster102", "Service100", "Component100", "Component 100", "Host100", "INSTALLED",
"", "", "", null));
 
     // set expectations
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 c480156..4f4709e 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
@@ -290,11 +290,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100", "Component 100",
         "Host100", "STARTED", "", null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102", "Component 102",
         "Host100", "STARTED", "", null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103", "Component 103",
         "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
@@ -392,11 +392,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100", "Component 100",
         "Host100", "STARTED", "", null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102", "Component 102",
         "Host100", "STARTED", "", null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103", "Component 103",
         "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
@@ -489,11 +489,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100", "Component 100",
         "Host100", "STARTED", "", null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102", "Component 102",
         "Host100", "INSTALLED", "", null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103", "Component 103",
         "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
@@ -691,7 +691,7 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100", "Component 100",
         "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
@@ -779,11 +779,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component100", "Component 100",
         "Host100", "STARTED", "", null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component102", "Component 102",
         "Host100", "INSTALLED", "", null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100",
"Component103", "Component 103",
         "Host100", "STARTED", "", null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 04e7427..92a4f7d 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -209,7 +209,7 @@ App.UpdateController = Em.Controller.extend({
         hostDetailsFilter = '',
         realUrl = '/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,'
+
             'alerts_summary,Hosts/host_status,Hosts/last_heartbeat_time,Hosts/ip,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,'
+
-            'host_components/HostRoles/stale_configs,host_components/HostRoles/service_name,host_components/HostRoles/desired_admin_state,'
+
+            'host_components/HostRoles/stale_configs,host_components/HostRoles/service_name,host_components/HostRoles/display_name,host_components/HostRoles/desired_admin_state,'
+
             '<metrics>Hosts/total_mem<hostDetailsParams><stackVersions>&minimal_response=true',
         hostDetailsParams = ',Hosts/os_arch,Hosts/os_type,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free',
         stackVersionInfo = ',stack_versions/HostStackVersions,' +
@@ -519,7 +519,7 @@ App.UpdateController = Em.Controller.extend({
   updateComponentsState: function (callback) {
     var testUrl = '/data/services/HDP2/components_state.json';
     var realUrl = '/components/?fields=ServiceComponentInfo/service_name,' +
-      'ServiceComponentInfo/category,ServiceComponentInfo/installed_count,ServiceComponentInfo/started_count,ServiceComponentInfo/total_count,host_components/HostRoles/host_name&minimal_response=true';
+      'ServiceComponentInfo/category,ServiceComponentInfo/installed_count,ServiceComponentInfo/started_count,ServiceComponentInfo/total_count,ServiceComponentInfo/display_name,host_components/HostRoles/host_name&minimal_response=true';
     var url = this.getUrl(testUrl, realUrl);
 
     App.HttpClient.get(url, App.componentsStateMapper, {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-web/app/mappers/components_state_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/components_state_mapper.js b/ambari-web/app/mappers/components_state_mapper.js
index ac3e1b5..755c0f5 100644
--- a/ambari-web/app/mappers/components_state_mapper.js
+++ b/ambari-web/app/mappers/components_state_mapper.js
@@ -28,6 +28,7 @@ App.componentsStateMapper = App.QuickDataMapper.create({
     service_id: 'ServiceComponentInfo.service_name',
     stack_info_id: 'ServiceComponentInfo.component_name',
     component_name: 'ServiceComponentInfo.component_name',
+    display_name: 'ServiceComponentInfo.display_name',
     service_name: 'ServiceComponentInfo.service_name',
     installed_count: 'ServiceComponentInfo.installed_count',
     started_count: 'ServiceComponentInfo.started_count',

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 7691f2b..d54c988 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -59,6 +59,7 @@ App.hostsMapper = App.QuickDataMapper.create({
   },
   hostComponentConfig: {
     component_name: 'HostRoles.component_name',
+    display_name: 'HostRoles.display_name',
     service_id: 'HostRoles.service_name',
     passive_state: 'HostRoles.maintenance_state',
     work_status: 'HostRoles.state',

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-web/app/models/client_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/client_component.js b/ambari-web/app/models/client_component.js
index 816950c..7dde68a 100644
--- a/ambari-web/app/models/client_component.js
+++ b/ambari-web/app/models/client_component.js
@@ -22,6 +22,7 @@ var stringUtils = require('utils/string_utils');
 App.ClientComponent = DS.Model.extend({
   service: DS.belongsTo('App.Service'),
   componentName: DS.attr('string'),
+  displayName: DS.attr('string'),
   installedCount: DS.attr('number'),
   startedCount: DS.attr('number'),
   totalCount: DS.attr('number'),
@@ -36,14 +37,6 @@ App.ClientComponent = DS.Model.extend({
     return 'value_for_'+this.get('componentName').toLowerCase();
   }.property('componentName'),
 
-  displayName: function() {
-    var displayName = App.format.role(this.get('componentName'));
-    if (this.get('service.serviceName') === this.get('componentName')) {
-      displayName += ' ' + Em.I18n.t('common.client');
-    }
-    return displayName;
-  }.property('componentName'),
-
   displayNamePluralized: function() {
     return stringUtils.pluralize(this.get('installedCount'), this.get('displayName'));
   }.property('installedCount')

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/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 b7a5f5a..a3abd08 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -22,6 +22,7 @@ App.HostComponent = DS.Model.extend({
   workStatus: DS.attr('string'),
   passiveState: DS.attr('string'),
   componentName: DS.attr('string'),
+  displayName: DS.attr('string'),
   haStatus: DS.attr('string'),
   displayNameAdvanced: DS.attr('string'),
   staleConfigs: DS.attr('boolean'),
@@ -60,12 +61,6 @@ App.HostComponent = DS.Model.extend({
   isNotInstalled: Em.computed.existsIn('workStatus', ['INIT', 'INSTALL_FAILED']),
 
   /**
-   * Formatted <code>componentName</code>
-   * @returns {String}
-   */
-  displayName: Em.computed.formatRole('componentName'),
-
-  /**
    * Determine if component is master
    * @returns {bool}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/b81db70e/ambari-web/test/models/host_component_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/host_component_test.js b/ambari-web/test/models/host_component_test.js
index 92e3d50..202f5c5 100644
--- a/ambari-web/test/models/host_component_test.js
+++ b/ambari-web/test/models/host_component_test.js
@@ -52,23 +52,6 @@ describe('App.HostComponent', function() {
     });
   });
 
-  describe('#displayName', function() {
-
-    beforeEach(function () {
-      sinon.stub(App.format, 'role', Em.K);
-      hc.propertyDidChange('displayName');
-      hc.get('displayName');
-    });
-
-    afterEach(function () {
-      App.format.role.restore();
-    });
-
-    it('App.format.role is called with correct data', function() {
-      expect(App.format.role.calledWith('COMP1')).to.be.true;
-    });
-  });
-
   describe('#isMaster', function() {
 
     beforeEach(function () {


Mime
View raw message