ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject git commit: AMBARI-5891 Convert Dashboard / Service pages to use aggregate counts provided by the API, rather than using client-computed info. (atkach)
Date Mon, 26 May 2014 12:13:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 6f740bed9 -> 572e2a3c1


AMBARI-5891 Convert Dashboard / Service pages to use aggregate counts provided by the API, rather than using client-computed info. (atkach)


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

Branch: refs/heads/trunk
Commit: 572e2a3c13830e5cc6ea2e8a2161d75b0b3279b9
Parents: 6f740be
Author: atkach <atkach@hortonworks.com>
Authored: Mon May 26 15:11:08 2014 +0300
Committer: atkach <atkach@hortonworks.com>
Committed: Mon May 26 15:11:08 2014 +0300

----------------------------------------------------------------------
 .../controllers/global/cluster_controller.js    |   9 +-
 .../app/controllers/global/update_controller.js |  11 ++
 ambari-web/app/mappers.js                       |   1 +
 .../app/mappers/components_state_mapper.js      | 144 +++++++++++++++++++
 .../app/mappers/service_metrics_mapper.js       |  26 +++-
 ambari-web/app/models/service.js                |  19 +++
 ambari-web/app/models/service/hbase.js          |   6 +-
 ambari-web/app/models/service/hdfs.js           |   6 +-
 ambari-web/app/models/service/mapreduce.js      |   6 +-
 ambari-web/app/models/service/mapreduce2.js     |   4 +-
 ambari-web/app/models/service/yarn.js           |  11 +-
 .../main/dashboard/widgets/hbase_links.hbs      |   2 +-
 .../main/dashboard/widgets/hdfs_links.hbs       |   4 +-
 .../main/dashboard/widgets/mapreduce_links.hbs  |   2 +-
 .../main/service/info/summary/falcon.hbs        |   2 +-
 .../main/service/info/summary/ganglia.hbs       |   4 +-
 .../main/service/info/summary/hive.hbs          |   2 +-
 .../main/service/info/summary/mapreduce2.hbs    |   2 +-
 .../main/service/info/summary/oozie.hbs         |   2 +-
 .../templates/main/service/info/summary/pig.hbs |   2 +-
 .../main/service/info/summary/sqoop.hbs         |   2 +-
 .../templates/main/service/info/summary/tez.hbs |   2 +-
 .../main/service/info/summary/zookeeper.hbs     |   2 +-
 .../templates/main/service/services/hbase.hbs   |   2 +-
 .../templates/main/service/services/hdfs.hbs    |   6 +-
 .../main/service/services/mapreduce.hbs         |   2 +-
 .../templates/main/service/services/storm.hbs   |   2 +-
 .../templates/main/service/services/yarn.hbs    |   2 +-
 .../main/dashboard/widgets/datanode_live.js     |  22 +--
 .../dashboard/widgets/node_managers_live.js     |  16 +--
 .../main/dashboard/widgets/tasktracker_live.js  |  20 ++-
 .../app/views/main/service/info/summary.js      |  46 +-----
 ambari-web/app/views/main/service/service.js    |   9 +-
 .../app/views/main/service/services/hbase.js    |  25 ++--
 .../app/views/main/service/services/hdfs.js     |  28 ++--
 .../views/main/service/services/mapreduce.js    |  30 ++--
 .../app/views/main/service/services/storm.js    |  13 --
 .../app/views/main/service/services/yarn.js     |  28 ++--
 38 files changed, 316 insertions(+), 206 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 8e0c148..8d0dcf5 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -60,7 +60,8 @@ App.ClusterController = Em.Controller.extend({
     'clusterStatus': false,
     'racks': false,
     'users': false,
-    'componentConfigs': false
+    'componentConfigs': false,
+    'componentsState': false
   }),
 
   /**
@@ -352,7 +353,11 @@ App.ClusterController = Em.Controller.extend({
             self.updateLoadStatus('componentConfigs');
           }
         }, true);
-        App.router.get('updateController').updateServiceMetric(function () {});
+        App.router.get('updateController').updateServiceMetric(function () {
+          App.router.get('updateController').updateComponentsState(function () {
+            self.updateLoadStatus('componentsState');
+          });
+        });
       });
     });
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/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 cb84bb4..c7fa022 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -80,6 +80,7 @@ App.UpdateController = Em.Controller.extend({
       App.updater.run(this, 'updateServices', 'isWorking');
       App.updater.run(this, 'updateHostConditionally', 'isWorking');
       App.updater.run(this, 'updateServiceMetricConditionally', 'isWorking', App.componentsUpdateInterval);
+      App.updater.run(this, 'updateComponentsState', 'isWorking', App.componentsUpdateInterval);
       App.updater.run(this, 'graphsUpdate', 'isWorking');
       if (App.supports.hostOverrides) {
         App.updater.run(this, 'updateComponentConfig', 'isWorking');
@@ -246,5 +247,15 @@ App.UpdateController = Em.Controller.extend({
     App.HttpClient.get(componentConfigUrl, App.componentConfigMapper, {
       complete: callback
     });
+  },
+  updateComponentsState: function (callback) {
+    var testUrl = '';
+    var realUrl = '/components/?ServiceComponentInfo/category.in(SLAVE,CLIENT)&fields=ServiceComponentInfo/service_name,' +
+      'ServiceComponentInfo/installed_count,ServiceComponentInfo/started_count,ServiceComponentInfo/total_count&minimal_response=true';
+    var url = this.getUrl(testUrl, realUrl);
+
+    App.HttpClient.get(url, App.componentsStateMapper, {
+      complete: callback
+    });
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/mappers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers.js b/ambari-web/app/mappers.js
index 08d40fe..1c431ae 100644
--- a/ambari-web/app/mappers.js
+++ b/ambari-web/app/mappers.js
@@ -31,4 +31,5 @@ require('mappers/service_metrics_mapper');
 require('mappers/target_cluster_mapper');
 require('mappers/dataset_mapper');
 require('mappers/component_config_mapper');
+require('mappers/components_state_mapper');
 require('mappers/jobs/hive_jobs_mapper');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/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
new file mode 100644
index 0000000..b29f882
--- /dev/null
+++ b/ambari-web/app/mappers/components_state_mapper.js
@@ -0,0 +1,144 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+var App = require('app');
+var stringUtils = require('utils/string_utils');
+
+App.componentsStateMapper = App.QuickDataMapper.create({
+
+  model: App.Service,
+  paths: {
+    INSTALLED_PATH: 'ServiceComponentInfo.installed_count',
+    STARTED_PATH: 'ServiceComponentInfo.started_count',
+    TOTAL_PATH: 'ServiceComponentInfo.total_count'
+  },
+  configMap: {
+    'DATANODE': {
+      data_nodes_started: 'STARTED_PATH',
+      data_nodes_installed: 'INSTALLED_PATH',
+      data_nodes_total: 'TOTAL_PATH'
+    },
+    'NODEMANAGER': {
+      node_managers_started: 'STARTED_PATH',
+      node_managers_installed: 'INSTALLED_PATH',
+      node_managers_total: 'TOTAL_PATH'
+    },
+    'TASKTRACKER': {
+      task_trackers_started: 'STARTED_PATH',
+      task_trackers_installed: 'INSTALLED_PATH',
+      task_trackers_total: 'TOTAL_PATH'
+    },
+    'HBASE_REGIONSERVER': {
+      region_servers_started: 'STARTED_PATH',
+      region_servers_installed: 'INSTALLED_PATH',
+      region_servers_total: 'TOTAL_PATH'
+    },
+    'GANGLIA_MONITOR': {
+      ganglia_monitors_started: 'STARTED_PATH',
+      ganglia_monitors_installed: 'INSTALLED_PATH',
+      ganglia_monitors_total: 'TOTAL_PATH'
+    },
+    'SUPERVISOR': {
+      super_visors_started: 'STARTED_PATH',
+      super_visors_installed: 'INSTALLED_PATH',
+      super_visors_total: 'TOTAL_PATH'
+    },
+    'MAPREDUCE2_CLIENT': {
+      map_reduce2_clients: 'INSTALLED_PATH'
+    },
+    'TEZ_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'HIVE_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'FALCON_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'OOZIE_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'ZOOKEEPER_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'PIG': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'SQOOP': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'YARN_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    },
+    'HDFS_CLIENT': {
+      installed_clients: 'INSTALLED_PATH'
+    }
+  },
+  /**
+   * get formatted component config
+   * @param componentName
+   * @return {Object}
+   */
+  getComponentConfig: function (componentName) {
+    var config = {};
+    var componentConfig = this.get('configMap')[componentName];
+    var paths = this.get('paths');
+
+    for (var property in componentConfig) {
+      if (paths[componentConfig[property]]) {
+        config[property] = paths[componentConfig[property]];
+      }
+    }
+    return config;
+  },
+  /**
+   * get service extended model if it has one
+   * @param serviceName
+   * @return {Object|null}
+   */
+  getExtendedModel: function (serviceName) {
+    if (App[App.Service.extendedModel[serviceName]]) {
+      return App[App.Service.extendedModel[serviceName]].find(serviceName);
+    }
+    return null;
+  },
+
+  map: function (json) {
+    console.time('App.componentsStateMapper execution time');
+
+    if (json.items) {
+      json.items.forEach(function (item) {
+        var componentConfig = this.getComponentConfig(item.ServiceComponentInfo.component_name);
+        var parsedItem = this.parseIt(item, componentConfig);
+        var service = App.Service.find(item.ServiceComponentInfo.service_name);
+        var extendedModel = this.getExtendedModel(item.ServiceComponentInfo.service_name);
+        var cacheService = App.cache['services'].findProperty('ServiceInfo.service_name', item.ServiceComponentInfo.service_name);
+
+        for (var i in parsedItem) {
+          cacheService[i] = parsedItem[i];
+          if (service.get('isLoaded')) {
+            service.set(stringUtils.underScoreToCamelCase(i), parsedItem[i]);
+            if (extendedModel) {
+              extendedModel.set(stringUtils.underScoreToCamelCase(i), parsedItem[i]);
+            }
+          }
+        }
+      }, this)
+    }
+    console.timeEnd('App.componentsStateMapper execution time');
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/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 db23683..3aef563 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -32,7 +32,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     $rand: Math.random(),
     $alerts: [ 1, 2, 3 ],
     host_components: 'host_components',
-    tool_tip_content: 'tool_tip_content'
+    tool_tip_content: 'tool_tip_content',
+    installed_clients: 'installed_clients'
   },
   hdfsConfig: {
     version: 'nameNodeComponent.host_components[0].metrics.dfs.namenode.Version',
@@ -57,7 +58,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     upgrade_status: 'nameNodeComponent.host_components[0].metrics.dfs.namenode.UpgradeFinalized',
     safe_mode_status: 'nameNodeComponent.host_components[0].metrics.dfs.namenode.Safemode',
     name_node_cpu: 'nameNodeComponent.host_components[0].metrics.cpu.cpu_wio',
-    name_node_rpc: 'nameNodeComponent.host_components[0].metrics.rpc.RpcQueueTime_avg_time'
+    name_node_rpc: 'nameNodeComponent.host_components[0].metrics.rpc.RpcQueueTime_avg_time',
+    data_nodes_started: 'data_nodes_started',
+    data_nodes_installed: 'data_nodes_installed',
+    data_nodes_total: 'data_nodes_total'
   },
   yarnConfig: {
     version: 'resourceManagerComponent.ServiceComponentInfo.Version',
@@ -82,11 +86,15 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     allocated_memory: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AllocatedMB',
     available_memory: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AvailableMB',
     reserved_memory: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.ReservedMB',
-    queue: 'resourceManagerComponent.queue'
+    queue: 'resourceManagerComponent.queue',
+    node_managers_started: 'node_managers_started',
+    node_managers_installed: 'node_managers_installed',
+    node_managers_total: 'node_managers_total'
   },
   mapReduce2Config: {
     version: 'jobHistoryServerComponent.ServiceComponentInfo.Version',
-    job_history_server_id: 'jobHistoryServerComponent.host_components[0].HostRoles.host_name'
+    job_history_server_id: 'jobHistoryServerComponent.host_components[0].HostRoles.host_name',
+    map_reduce2_clients: 'map_reduce2_clients'
   },
   mapReduceConfig: {
     version: 'jobTrackerComponent.ServiceComponentInfo.Version',
@@ -113,7 +121,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     reduces_waiting: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.waiting_reduces',
     trackers_decommissioned: 'jobTrackerComponent.host_components[0].metrics.mapred.jobtracker.trackers_decommissioned',
     job_tracker_cpu: 'jobTrackerComponent.host_components[0].metrics.cpu.cpu_wio',
-    job_tracker_rpc: 'jobTrackerComponent.host_components[0].metrics.rpc.RpcQueueTime_avg_time'
+    job_tracker_rpc: 'jobTrackerComponent.host_components[0].metrics.rpc.RpcQueueTime_avg_time',
+    task_trackers_started: 'task_trackers_started',
+    task_trackers_installed: 'task_trackers_installed',
+    task_trackers_total: 'task_trackers_total'
   },
   hbaseConfig: {
     version: 'masterComponent.ServiceComponentInfo.Version',
@@ -124,7 +135,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     regions_in_transition: 'regions_in_transition',
     revision: 'masterComponent.ServiceComponentInfo.Revision',
     heap_memory_used: 'masterComponent.ServiceComponentInfo.HeapMemoryUsed',
-    heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax'
+    heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax',
+    region_servers_started: 'region_servers_started',
+    region_servers_installed: 'region_servers_installed',
+    region_servers_total: 'region_servers_total'
   },
   stormConfig: {
     total_tasks: 'restApiComponent.metrics.api.cluster.summary.["tasks.total"]',

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index 7874dfa..e2aabb6 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -31,6 +31,11 @@ App.Service = DS.Model.extend({
   quickLinks: DS.hasMany('App.QuickLinks'),  // mapped in app/mappers/service_metrics_mapper.js method - mapQuickLinks
   hostComponents: DS.hasMany('App.HostComponent'),
   serviceConfigsTemplate: App.config.get('preDefinedServiceConfigs'),
+  /**
+   * used by services("OOZIE", "ZOOKEEPER", "HIVE", "MAPREDUCE2", "TEZ", "SQOOP", "PIG","FALCON")
+   * that have only client components
+   */
+  installedClients: DS.attr('number'),
 
   /**
    * @type {bool}
@@ -233,4 +238,18 @@ App.Service.servicesSortOrder = [
   'HUE'
 ];
 
+/**
+ * association between service and extended model name
+ * @type {Object}
+ */
+App.Service.extendedModel = {
+  'HDFS': 'HDFSService',
+  'MAPREDUCE': 'MapReduceService',
+  'HBASE': 'HBaseService',
+  'YARN': 'YARNService',
+  'MAPREDUCE2': 'MapReduce2Service',
+  'STORM': 'StormService',
+  'FLUME': 'FlumeService'
+};
+
 App.Service.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/models/service/hbase.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/hbase.js b/ambari-web/app/models/service/hbase.js
index 5638a3d..1276a4d 100644
--- a/ambari-web/app/models/service/hbase.js
+++ b/ambari-web/app/models/service/hbase.js
@@ -20,9 +20,9 @@ var App = require('app');
 App.HBaseService = App.Service.extend({
   version: DS.attr('string'),
   master: DS.belongsTo('App.Host'),
-  regionServers: function () {
-    return this.get('hostComponents').filterProperty('componentName', 'HBASE_REGIONSERVER');
-  }.property('hostComponents.@each'),
+  regionServersStarted: DS.attr('number'),
+  regionServersInstalled: DS.attr('number'),
+  regionServersTotal: DS.attr('number'),
   masterStartTime: DS.attr('number'),
   masterActiveTime: DS.attr('number'),
   averageLoad: DS.attr('number'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/models/service/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/hdfs.js b/ambari-web/app/models/service/hdfs.js
index 8dfdfd4..bd8d34f 100644
--- a/ambari-web/app/models/service/hdfs.js
+++ b/ambari-web/app/models/service/hdfs.js
@@ -24,9 +24,9 @@ App.HDFSService = App.Service.extend({
   activeNameNode: DS.belongsTo('App.Host'),
   standbyNameNode: DS.belongsTo('App.Host'),
   standbyNameNode2: DS.belongsTo('App.Host'),
-  dataNodes: function () {
-    return this.get('hostComponents').filterProperty('componentName', 'DATANODE');
-  }.property('hostComponents.@each'),
+  dataNodesStarted: DS.attr('number'),
+  dataNodesInstalled: DS.attr('number'),
+  dataNodesTotal: DS.attr('number'),
   journalNodes: function () {
     return this.get('hostComponents').filterProperty('componentName', 'JOURNALNODE');
   }.property('hostComponents.@each'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/models/service/mapreduce.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/mapreduce.js b/ambari-web/app/models/service/mapreduce.js
index 804d2a2..712543a 100644
--- a/ambari-web/app/models/service/mapreduce.js
+++ b/ambari-web/app/models/service/mapreduce.js
@@ -21,9 +21,9 @@ App.MapReduceService = App.Service.extend({
   version: DS.attr('string'),
   jobHistoryServer: DS.belongsTo('App.Host'),
   jobTracker: DS.belongsTo('App.Host'),
-  taskTrackers: function () {
-    return this.get('hostComponents').filterProperty('componentName', 'TASKTRACKER');
-  }.property('hostComponents.@each'),
+  taskTrackersStarted: DS.attr('number'),
+  taskTrackersInstalled: DS.attr('number'),
+  taskTrackersTotal: DS.attr('number'),
   jobTrackerStartTime: DS.attr('number'),
   jobTrackerHeapUsed: DS.attr('number'),
   jobTrackerHeapMax: DS.attr('number'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/models/service/mapreduce2.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/mapreduce2.js b/ambari-web/app/models/service/mapreduce2.js
index cdb2525..8a3a968 100644
--- a/ambari-web/app/models/service/mapreduce2.js
+++ b/ambari-web/app/models/service/mapreduce2.js
@@ -20,9 +20,7 @@ var App = require('app');
 App.MapReduce2Service = App.Service.extend({
   version: DS.attr('string'),
   jobHistoryServer: DS.belongsTo('App.Host'),
-  mapReduce2Clients: function(){
-    return this.get('hostComponents').filterProperty('componentName', 'MAPREDUCE2_CLIENT').mapProperty('host');
-  }.property('hostComponents.length')
+  mapReduce2Clients: DS.attr('number')
 });
 
 App.MapReduce2Service.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/models/service/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/yarn.js b/ambari-web/app/models/service/yarn.js
index 68850c6..e7cb929 100644
--- a/ambari-web/app/models/service/yarn.js
+++ b/ambari-web/app/models/service/yarn.js
@@ -24,9 +24,9 @@ App.YARNService = App.Service.extend({
   appTimelineServerNode: function() {
     return this.get('hostComponents').filterProperty('componentName', 'APP_TIMELINE_SERVER').mapProperty('host').objectAt(0);
   }.property(),
-  nodeManagerNodes: function () {
-    return this.get('hostComponents').filterProperty('componentName', 'NODEMANAGER');
-  }.property('hostComponents.@each'),
+  nodeManagersStarted: DS.attr('number'),
+  nodeManagersInstalled: DS.attr('number'),
+  nodeManagersTotal: DS.attr('number'),
   nodeManagersCountActive: DS.attr('number'),
   nodeManagersCountUnhealthy: DS.attr('number'),
   nodeManagersCountRebooted: DS.attr('number'),
@@ -107,15 +107,14 @@ App.YARNService = App.Service.extend({
    * states, we calculate the lost count.
    */
   nodeManagersCountLost: function () {
-    var allNMs = this.get('nodeManagerNodes');
-    var totalCount = allNMs != null ? allNMs.get('length') : 0;
+    var totalCount = this.get('nodeManagersTotal');
     var activeCount = this.get('nodeManagersCountActive');
     var rebootedCount = this.get('nodeManagersCountRebooted');
     var unhealthyCount = this.get('nodeManagersCountUnhealthy');
     var decomCount = this.get('nodeManagersCountDecommissioned');
     var nonLostHostsCount = activeCount + rebootedCount + decomCount + unhealthyCount;
     return totalCount >= nonLostHostsCount ? totalCount - nonLostHostsCount : 0;
-  }.property('nodeManagerNodes', 'nodeManagersCountActive', 'nodeManagersCountRebooted', 'nodeManagersCountUnhealthy', 'nodeManagersCountDecommissioned')
+  }.property('nodeManagersTotal', 'nodeManagersCountActive', 'nodeManagersCountRebooted', 'nodeManagersCountUnhealthy', 'nodeManagersCountDecommissioned')
 });
 
 App.YARNService.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
index 2726080..10ab753 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
@@ -36,7 +36,7 @@
           </tr>
           <!--region servers-->
           <tr>
-              <td><a href="#" {{action filterHosts view.component}}>{{view.model.regionServers.length}} {{t dashboard.services.hbase.regionServers}}</a></td>
+              <td><a href="#" {{action filterHosts view.component}}>{{view.model.regionServersTotal}} {{t dashboard.services.hbase.regionServers}}</a></td>
           </tr>
           <!--hbase master Web UI-->
           <tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
index 707b220..5b5100b 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
@@ -52,7 +52,7 @@
           <!--Data Nodes-->
           <tr>
             <td>
-              <a href="#" {{action filterHosts view.component}}>{{view.model.dataNodes.length}} {{t dashboard.services.hdfs.datanodes}}</a>
+              <a href="#" {{action filterHosts view.component}}>{{view.model.dataNodesTotal}} {{t dashboard.services.hdfs.datanodes}}</a>
             </td>
           </tr>
         </table>
@@ -69,7 +69,7 @@
           <!--Data Nodes-->
           <tr>
             <td>
-              <a href="#" {{action filterHosts view.component}}>{{view.model.dataNodes.length}} {{t dashboard.services.hdfs.datanodes}}</a>
+              <a href="#" {{action filterHosts view.component}}>{{view.model.dataNodesTotal}} {{t dashboard.services.hdfs.datanodes}}</a>
             </td>
           </tr>
         </table>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
index 815e694..abb9da1 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
@@ -32,7 +32,7 @@
           </tr>
           <!--taskTrackers-->
           <tr>
-            <td><a href="#" {{action filterHosts view.component}}>{{view.model.taskTrackers.length}} {{t dashboard.services.mapreduce.taskTrackers}}</a></td>
+            <td><a href="#" {{action filterHosts view.component}}>{{view.model.taskTrackersTotal}} {{t dashboard.services.mapreduce.taskTrackers}}</a></td>
           </tr>
           <!--jobTracker Web UI-->
           <tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/falcon.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/falcon.hbs b/ambari-web/app/templates/main/service/info/summary/falcon.hbs
index eb79ead..5f82156 100644
--- a/ambari-web/app/templates/main/service/info/summary/falcon.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/falcon.hbs
@@ -21,6 +21,6 @@
 <tr>
     <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.falcon.client" plural="t:services.falcon.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.falcon.client" plural="t:services.falcon.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.falcon.client" plural="t:services.falcon.clients"}} {{t common.installed}}
     </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/ganglia.hbs b/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
index 3e09b96..c510f2c 100644
--- a/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
@@ -24,8 +24,8 @@
   <td class="summary-label"><a {{action filterHosts view.monitorsObj}} href="javascript:void(null)" >{{t services.ganglia.monitors}}</a></td>
   <td>
     <span>
-      {{#view view.monitorsLiveTextView}}
-        {{view.monitors}}
+      {{#view App.ComponentLiveTextView liveComponentsBinding="content.gangliaMonitorsStarted"}}
+        {{view.parentView.monitors}}
       {{/view}}
     </span> {{t services.service.summary.GangliaMonitorsLIVE}}
   </td>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/hive.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/hive.hbs b/ambari-web/app/templates/main/service/info/summary/hive.hbs
index 749e77c..93705ce 100644
--- a/ambari-web/app/templates/main/service/info/summary/hive.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/hive.hbs
@@ -21,6 +21,6 @@
 <tr>
     <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.hive.client" plural="t:services.hive.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.hive.client" plural="t:services.hive.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.hive.client" plural="t:services.hive.clients"}} {{t common.installed}}
     </td>
 </tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs b/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
index 6a03c2e..7158dec 100644
--- a/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
@@ -20,6 +20,6 @@
 <tr>
     <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.mapReduce2Clients}} </span>{{pluralize view.clients.length singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}} {{t common.installed}}
     </td>
 </tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/oozie.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/oozie.hbs b/ambari-web/app/templates/main/service/info/summary/oozie.hbs
index a59b158..af84caa 100644
--- a/ambari-web/app/templates/main/service/info/summary/oozie.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/oozie.hbs
@@ -22,7 +22,7 @@
 <tr>
     <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.oozie.client" plural="t:services.oozie.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.oozie.client" plural="t:services.oozie.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.oozie.client" plural="t:services.oozie.clients"}} {{t common.installed}}
     </td>
 </tr>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/pig.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/pig.hbs b/ambari-web/app/templates/main/service/info/summary/pig.hbs
index 692f79d..0f687c1 100644
--- a/ambari-web/app/templates/main/service/info/summary/pig.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/pig.hbs
@@ -18,6 +18,6 @@
 <tr>
   <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.pig.client" plural="t:services.pig.clients"}}</a></td>
   <td>
-    <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.pig.client" plural="t:services.pig.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.pig.client" plural="t:services.pig.clients"}} {{t common.installed}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/sqoop.hbs b/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
index 3a2cec9..5d6384b 100644
--- a/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
@@ -18,6 +18,6 @@
 <tr>
   <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}}</a></td>
   <td>
-    <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}} {{t common.installed}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/tez.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/tez.hbs b/ambari-web/app/templates/main/service/info/summary/tez.hbs
index aa68642..d06c67d 100644
--- a/ambari-web/app/templates/main/service/info/summary/tez.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/tez.hbs
@@ -18,6 +18,6 @@
 <tr>
   <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.tez.client" plural="t:services.tez.clients"}}</a></td>
   <td>
-    <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.tez.client" plural="t:services.tez.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.tez.client" plural="t:services.tez.clients"}} {{t common.installed}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs b/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
index f9071f0..5ec6185 100644
--- a/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
@@ -22,6 +22,6 @@
 <tr>
     <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.clients.length}} </span>{{pluralize view.clients.length singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}} {{t common.installed}}
     </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/services/hbase.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/hbase.hbs b/ambari-web/app/templates/main/service/services/hbase.hbs
index ca6fa5a..5182030 100644
--- a/ambari-web/app/templates/main/service/services/hbase.hbs
+++ b/ambari-web/app/templates/main/service/services/hbase.hbs
@@ -24,7 +24,7 @@
   </td>
   <td>
     <span>
-      {{#view view.regionServersLiveTextView}}
+      {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.regionServersStarted" totalComponentsBinding="view.service.regionServersTotal"}}
         {{view.liveComponents}}/{{view.totalComponents}}
       {{/view}}
     </span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/services/hdfs.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/hdfs.hbs b/ambari-web/app/templates/main/service/services/hdfs.hbs
index e03a7b3..df6c36a 100644
--- a/ambari-web/app/templates/main/service/services/hdfs.hbs
+++ b/ambari-web/app/templates/main/service/services/hdfs.hbs
@@ -22,7 +22,7 @@
   <td><a href="#" {{action filterHosts view.dataNodeComponent}}>{{t dashboard.services.hdfs.datanodes}}</a></td>
   <td>
     <span>
-      {{#view view.dataNodesLiveTextView}}
+      {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.dataNodesStarted" totalComponentsBinding="view.service.dataNodesTotal"}}
         {{view.liveComponents}}/{{view.totalComponents}}
       {{/view}}
     </span>
@@ -58,8 +58,8 @@
 <tr>
   <td>{{t dashboard.services.hdfs.datanodecounts}}</td>
   <td>
-    {{view.dataNodesLive.length}} {{t dashboard.services.hdfs.nodes.live}} /
-    {{view.dataNodesDead.length}} {{t dashboard.services.hdfs.nodes.dead}} /
+    {{view.dataNodesLive}} {{t dashboard.services.hdfs.nodes.live}} /
+    {{view.dataNodesDead}} {{t dashboard.services.hdfs.nodes.dead}} /
     {{view.service.decommissionDataNodes.length}} {{t dashboard.services.hdfs.nodes.decom}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/services/mapreduce.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/mapreduce.hbs b/ambari-web/app/templates/main/service/services/mapreduce.hbs
index 26cd275..51e6f38 100644
--- a/ambari-web/app/templates/main/service/services/mapreduce.hbs
+++ b/ambari-web/app/templates/main/service/services/mapreduce.hbs
@@ -24,7 +24,7 @@
   </td>
   <td>
     <span>
-      {{#view view.trackersLiveTextView}}
+      {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.taskTrackersStarted" totalComponentsBinding="view.service.taskTrackersTotal"}}
         {{view.liveComponents}}/{{view.totalComponents}}
       {{/view}}
     </span> {{t services.service.summary.TrackersLive}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/services/storm.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/storm.hbs b/ambari-web/app/templates/main/service/services/storm.hbs
index eaa2afe..b260d6b 100644
--- a/ambari-web/app/templates/main/service/services/storm.hbs
+++ b/ambari-web/app/templates/main/service/services/storm.hbs
@@ -25,7 +25,7 @@
   </td>
   <td>
     <span>
-      {{#view view.superVisorsLiveTextView}}
+      {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.superVisorsStarted" totalComponentsBinding="view.service.superVisorsTotal"}}
         {{view.liveComponents}}/{{view.totalComponents}}
       {{/view}}
     </span> {{t services.service.summary.SupervisorsLIVE}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/templates/main/service/services/yarn.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/yarn.hbs b/ambari-web/app/templates/main/service/services/yarn.hbs
index 3c1641a..617dee5 100644
--- a/ambari-web/app/templates/main/service/services/yarn.hbs
+++ b/ambari-web/app/templates/main/service/services/yarn.hbs
@@ -22,7 +22,7 @@
   <td><a href="#" {{action filterHosts view.nodeManagerComponent}}>{{t dashboard.services.yarn.nodeManagers}}</a></td>
   <td>
     <span>
-      {{#view view.nodeManagersLiveTextView}}
+      {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.nodeManagersStarted" totalComponentsBinding="view.service.nodeManagersTotal"}}
         {{view.liveComponents}}/{{view.totalComponents}}
       {{/view}}
     </span>{{t services.service.summary.nodeManagersLive}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/dashboard/widgets/datanode_live.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/datanode_live.js b/ambari-web/app/views/main/dashboard/widgets/datanode_live.js
index 227da27..6bbdf5a 100644
--- a/ambari-web/app/views/main/dashboard/widgets/datanode_live.js
+++ b/ambari-web/app/views/main/dashboard/widgets/datanode_live.js
@@ -30,8 +30,8 @@ App.DataNodeUpView = App.TextDashboardWidgetView.extend({
 
   hiddenInfo: function () {
     var result = [];
-    result.pushObject(this.get('dataNodesLive').length + ' ' + Em.I18n.t('dashboard.services.hdfs.nodes.live'));
-    result.pushObject(this.get('dataNodesDead').length + ' ' + Em.I18n.t('dashboard.services.hdfs.nodes.dead'));
+    result.pushObject(this.get('dataNodesLive') + ' ' + Em.I18n.t('dashboard.services.hdfs.nodes.live'));
+    result.pushObject(this.get('dataNodesDead') + ' ' + Em.I18n.t('dashboard.services.hdfs.nodes.dead'));
     result.pushObject(this.get('model.decommissionDataNodes.length')+ ' ' + Em.I18n.t('dashboard.services.hdfs.nodes.decom'));
     return result;
   }.property('dataNodesLive', 'dataNodesDead', 'model.decommissionDataNodes.length'),
@@ -42,23 +42,23 @@ App.DataNodeUpView = App.TextDashboardWidgetView.extend({
   maxValue: 100,
 
   dataNodesLive: function () {
-    return this.get('model.dataNodes').filterProperty("workStatus", "STARTED");
-  }.property('model.dataNodes.@each.workStatus'),
+    return this.get('model.dataNodesStarted');
+  }.property('model.dataNodesStarted'),
   dataNodesDead: function () {
-    return this.get('model.dataNodes').filterProperty("workStatus", "INSTALLED");
-  }.property('model.dataNodes.@each.workStatus'),
+    return this.get('model.dataNodesInstalled');
+  }.property('model.dataNodesInstalled'),
 
   data: function () {
-    if ( !this.get('model.dataNodes.length')) {
+    if ( !this.get('model.dataNodesTotal')) {
       return -1;
     } else {
-      return ((this.get('dataNodesLive').length / this.get('model.dataNodes.length')).toFixed(2)) * 100;
+      return ((this.get('dataNodesLive') / this.get('model.dataNodesTotal')).toFixed(2)) * 100;
     }
-  }.property('model.dataNodes.length', 'dataNodesLive'),
+  }.property('model.dataNodesTotal', 'dataNodesLive'),
 
   content: function () {
-    return this.get('dataNodesLive').length + "/" + this.get('model.dataNodes.length');
-  }.property('model.dataNodes.length', 'dataNodesLive'),
+    return this.get('dataNodesLive') + "/" + this.get('model.dataNodesTotal');
+  }.property('model.dataNodesTotal', 'dataNodesLive'),
 
   editWidget: function (event) {
     var parent = this;

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
index 295610e..ae7b41f 100644
--- a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
+++ b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
@@ -47,24 +47,22 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({
   maxValue: 100,
 
   nodeManagersLive: function () {
-    return this.get('model.nodeManagerNodes').filterProperty("workStatus", "STARTED");
-  }.property('model.nodeManagerNodes.@each.workStatus'),
+    return this.get('model.nodeManagersStarted');
+  }.property('model.nodeManagersStarted'),
 
   data: function () {
-    var nodeManagers = this.get('model.nodeManagerNodes.length');
-    var nodeManagersLive = this.get('nodeManagersLive').length;
+    var nodeManagers = this.get('model.nodeManagersTotal');
+    var nodeManagersLive = this.get('nodeManagersLive');
     if (!nodeManagers) {
       return -1;
     } else {
       return (nodeManagersLive / nodeManagers).toFixed(2) * 100;
     }
-  }.property('model.nodeManagerNodes.length', 'nodeManagersLive'),
+  }.property('model.nodeManagersTotal', 'nodeManagersLive'),
 
   content: function () {
-    var nodeManagers = this.get('model.nodeManagerNodes.length');
-    var nodeManagersLive = this.get('nodeManagersLive').length;
-    return nodeManagersLive + '/' + nodeManagers;
-  }.property('model.nodeManagerNodes.length', 'nodeManagersLive'),
+    return this.get('nodeManagersLive') + '/' + this.get('model.nodeManagersTotal');
+  }.property('model.nodeManagersTotal', 'nodeManagersLive'),
 
   editWidget: function (event) {
     var parent = this;

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js b/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js
index 2bbf432..243d57c 100644
--- a/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js
+++ b/ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js
@@ -27,33 +27,29 @@ App.TaskTrackerUpView = App.TextDashboardWidgetView.extend({
 
   hiddenInfo: function () {
     var svc = this.get('model');
-    var liveCount = this.get('taskTrackersLive').length;
-    var totalCount = svc.get('taskTrackers').get('length');
+    var liveCount = svc.get('taskTrackersStarted');
+    var totalCount = svc.get('taskTrackersTotal');
     var result = [];
     result.pushObject(liveCount + " live");
     result.pushObject(totalCount + " total");
     return result;
-  }.property('model.taskTrackers.length', 'taskTrackersLive'),
+  }.property('model.taskTrackersTotal', 'model.taskTrackersStarted'),
 
   thresh1: 40,
   thresh2: 70,
   maxValue: 100,
 
-  taskTrackersLive: function () {
-    return this.get('model.taskTrackers').filterProperty("workStatus", "STARTED");
-  }.property('model.taskTrackers.@each.workStatus'),
-
   data: function () {
-    if (!this.get('model.taskTrackers.length')) {
+    if (!this.get('model.taskTrackersTotal')) {
       return -1;
     } else {
-      return (this.get('taskTrackersLive').length / this.get('model.taskTrackers.length')).toFixed(2) * 100;
+      return (this.get('model.taskTrackersStarted') / this.get('model.taskTrackersTotal')).toFixed(2) * 100;
     }
-  }.property('model.taskTrackers.length', 'taskTrackersLive'),
+  }.property('model.taskTrackersTotal', 'model.taskTrackersStarted'),
 
   content: function () {
-    return this.get('taskTrackersLive').length + "/" + this.get('model.taskTrackers.length');
-  }.property('model.taskTrackers.length', 'taskTrackersLive'),
+    return this.get('model.taskTrackersStarted') + "/" + this.get('model.taskTrackersTotal');
+  }.property('model.taskTrackersTotal', 'model.taskTrackersStarted'),
 
   editWidget: function (event) {
     var parent = this;

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index dd7ce7f..99ea72a 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -86,20 +86,12 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     return serviceName == "WEBHCAT" || serviceName == "NAGIOS";
   }.property('controller.content'),
 
-  clients: function () {
-    var service = this.get('controller.content');
-    if (this.get('servicesHaveClients').contains(service.get("id"))) {
-      return service.get('hostComponents').filterProperty('isClient');
-    }
-    return [];
-  }.property('controller.content'),
-
   hasManyServers: function () {
     return this.get('servers').length > 1;
   }.property('servers'),
 
   clientsHostText: function () {
-    if (this.get('clients').length == 0) {
+    if (this.get('controller.content.installedClients').length == 0) {
       return '';
     } else if (this.get("hasManyClients")) {
       return Em.I18n.t('services.service.summary.viewHosts');
@@ -109,8 +101,8 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   }.property("hasManyClients"),
 
   hasManyClients: function () {
-    return this.get('clients').length > 1;
-  }.property('clients'),
+    return this.get('controller.content.installedClients').length > 1;
+  }.property('controller.content.installedClients'),
 
   servers: function () {
     var result = [];
@@ -153,39 +145,15 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     var result = '';
     var service = this.get('controller.content');
     if (service.get("id") == "GANGLIA") {
-      var monitors = service.get('hostComponents').filterProperty('isMaster', false);
-      var liveMonitors = monitors.filterProperty("workStatus","STARTED").length;
-      this.set("liveMonitors", liveMonitors);
-      if (monitors.length) {
-        result = Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(liveMonitors, monitors.length);
+      var totalMonitors = service.get('gangliaMonitorsTotal');
+      var liveMonitors = service.get('gangliaMonitorsStarted');
+      if (totalMonitors) {
+        result = Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(liveMonitors, totalMonitors);
       }
     }
     return result;
   }.property('controller.content'),
 
-  monitorsLiveTextView: App.ComponentLiveTextView.extend({
-    liveComponents: function () {
-      var service = this.get('service');
-      if (service.get("id") == "GANGLIA") {
-        return service.get('hostComponents').filterProperty('isMaster', false).filterProperty("workStatus","STARTED").length;
-      } else {
-        return null;
-      }
-    }.property('service.hostComponents.@each'),
-    monitors: function () {
-      var result = '';
-      var service = this.get('parentView.controller.content');
-      if (service.get("id") == "GANGLIA") {
-        var monitors = service.get('hostComponents').filterProperty('isMaster', false);
-        var liveMonitors = monitors.filterProperty("workStatus","STARTED").length;
-        if (monitors.length) {
-          result = Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(liveMonitors, monitors.length);
-        }
-      }
-      return result;
-    }.property('service.hostComponents.@each')
-  }),
-
   hasManyMonitors: function () {
     var service = this.get('controller.content');
     if (service.get("id") == "GANGLIA") {

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/service.js b/ambari-web/app/views/main/service/service.js
index 58b0e1a..b8b6c42 100644
--- a/ambari-web/app/views/main/service/service.js
+++ b/ambari-web/app/views/main/service/service.js
@@ -113,13 +113,10 @@ App.MainDashboardServiceHealthView = Em.View.extend({
 
 App.ComponentLiveTextView =  Em.View.extend({
   classNameBindings: ['color:service-summary-component-red-dead:service-summary-component-green-live'],
-  service: function() { return this.get("parentView").get("service")}.property("parentView.service"),
-  liveComponents: function() {
-  }.property(),
-  totalComponents: function() {
-  }.property(),
+  liveComponents: null,
+  totalComponents: null,
   color: function() {
-    return this.get("liveComponents") == 0;
+    return this.get("liveComponents") === 0;
   }.property("liveComponents")
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/services/hbase.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hbase.js b/ambari-web/app/views/main/service/services/hbase.js
index 2d189d8..e70310c 100644
--- a/ambari-web/app/views/main/service/services/hbase.js
+++ b/ambari-web/app/views/main/service/services/hbase.js
@@ -39,29 +39,17 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
   }.property('masters'),
 
 
-  liveRegionServers: function () {
-    return this.get('service.regionServers').filterProperty("workStatus", "STARTED");
-  }.property('service.regionServers.@each.workStatus'),
 
   regionServesText: function () {
-    if (this.get('service.regionServers.length') == 0) {
+    if (this.get('service.regionServersTotal') == 0) {
       return '';
-    } else if (this.get('service.regionServers.length') > 1) {
+    } else if (this.get('service.regionServersTotal') > 1) {
       return Em.I18n.t('services.service.summary.viewHosts');
     } else {
       return Em.I18n.t('services.service.summary.viewHost');
     }
   }.property("service"),
 
-  regionServersLiveTextView: App.ComponentLiveTextView.extend({
-    liveComponents: function() {
-      return this.get('service.regionServers').filterProperty("workStatus","STARTED").get('length');
-    }.property('service.regionServers.@each.workStatus'),
-    totalComponents: function() {
-      return this.get("service.regionServers.length");
-    }.property("service.regionServers.length")
-  }),
-
   /**
    * One(!) active master component
    */
@@ -95,8 +83,8 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
     if (isNaN(avgLoad)) {
       avgLoad = this.t("services.service.summary.unknown");
     }
-    return this.t("dashboard.services.hbase.summary").format(this.get('service.regionServers.length'), avgLoad);
-  }.property('service.regionServers', 'service.averageLoad'),
+    return this.t("dashboard.services.hbase.summary").format(this.get('service.regionServersTotal'), avgLoad);
+  }.property('service.regionServersTotal', 'service.averageLoad'),
 
   hbaseMasterWebUrl: function () {
     if (this.get('activeMaster.host') && this.get('activeMaster.host').get('publicHostName')) {
@@ -139,7 +127,10 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
   }.property("service.masterActiveTime"),
 
   regionServerComponent: function () {
-    return this.get('service.regionServers').objectAt(0);
+    return Em.Object.create({
+      componentName: 'HBASE_REGIONSERVER'
+    });
+    //return this.get('service.regionServers').objectAt(0);
   }.property()
 
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/services/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hdfs.js b/ambari-web/app/views/main/service/services/hdfs.js
index 614d6d3..69a03d7 100644
--- a/ambari-web/app/views/main/service/services/hdfs.js
+++ b/ambari-web/app/views/main/service/services/hdfs.js
@@ -50,25 +50,16 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   }),
 
   dataNodesLive: function () {
-    return this.get('service.dataNodes').filterProperty("workStatus", "STARTED");
-  }.property('service.dataNodes.@each.workStatus'),
+    return this.get('service.dataNodesStarted');
+  }.property('service.dataNodesStarted'),
   dataNodesDead: function () {
-    return this.get('service.dataNodes').filterProperty("workStatus", "INSTALLED");
-  }.property('service.dataNodes.@each.workStatus'),
+    return this.get('service.dataNodesInstalled');
+  }.property('service.dataNodesInstalled'),
 
   showJournalNodes: function () {
     return this.get('service.journalNodes.length') > 0;
   }.property('service.journalNodes.length'),
 
-  dataNodesLiveTextView: App.ComponentLiveTextView.extend({
-    liveComponents: function () {
-      return this.get('service.dataNodes').filterProperty("workStatus", "STARTED").get("length");
-    }.property("service.dataNodes.@each.workStatus"),
-    totalComponents: function() {
-      return this.get("service.dataNodes.length");
-    }.property("service.dataNodes.length")
-  }),
-
   journalNodesLiveTextView: App.ComponentLiveTextView.extend({
     liveComponents: function () {
       return this.get('service.journalNodes').filterProperty("workStatus", "STARTED").get("length");
@@ -128,8 +119,8 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   summaryHeader: function () {
     var text = this.t("dashboard.services.hdfs.summary");
     var service = this.get('service');
-    var liveCount = service.get('dataNodes').filterProperty("workStatus", "STARTED").length;
-    var totalCount = service.get('dataNodes').get('length');
+    var liveCount = service.get('dataNodesStarted');
+    var totalCount = service.get('dataNodesTotal');
     var total = service.get('capacityTotal') + 0;
     var remaining = service.get('capacityRemaining') + 0;
     var used = total - remaining;
@@ -138,7 +129,7 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
       percent = Em.I18n.t('services.service.summary.notAvailable') + " ";
     }
     return text.format(liveCount, totalCount, percent);
-  }.property('service.dataNodes.@each.workStatus', 'service.capacityUsed', 'service.capacityTotal'),
+  }.property('service.dataNodesStarted', 'service.dataNodesTotal', 'service.capacityUsed', 'service.capacityTotal'),
 
   dfsUsedDisk: function () {
     var text = this.t("dashboard.services.hdfs.capacityUsed");
@@ -174,7 +165,10 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   }.property('service.capacityRemaining', 'service.capacityTotal'),
 
   dataNodeComponent: function () {
-    return this.get('service.dataNodes').objectAt(0);
+    return Em.Object.create({
+      componentName: 'DATANODE'
+    });
+    //return this.get('service.dataNodes').objectAt(0);
   }.property(),
 
   journalNodeComponent: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/services/mapreduce.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/mapreduce.js b/ambari-web/app/views/main/service/services/mapreduce.js
index 6a26e49..4b30b98 100644
--- a/ambari-web/app/views/main/service/services/mapreduce.js
+++ b/ambari-web/app/views/main/service/services/mapreduce.js
@@ -49,41 +49,32 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
   summaryHeader: function () {
     var svc = this.get('service');
     var liveCount = svc.get('aliveTrackers').get('length');
-    var allCount = svc.get('taskTrackers').get('length');
+    var allCount = svc.get('taskTrackersTotal');
     var runningCount = svc.get('jobsRunning');
     if (runningCount === null) {
       runningCount = 'n/a';
     }
     var template = this.t('dashboard.services.mapreduce.summary');
     return template.format(liveCount, allCount, runningCount);
-  }.property('service.aliveTrackers', 'service.taskTrackers', 'service.jobsRunning'),
+  }.property('service.aliveTrackers', 'service.taskTrackersTotal', 'service.jobsRunning'),
 
   trackersText: function () {
-    if (this.get('service').get('taskTrackers.length') == 0) {
+    if (this.get('service').get('taskTrackersTotal') == 0) {
       return '';
-    } else if (this.get('service').get('taskTrackers.length') > 1){
+    } else if (this.get('service').get('taskTrackersTotal') > 1){
       return Em.I18n.t('services.service.summary.viewHosts');
     }else{
       return Em.I18n.t('services.service.summary.viewHost');
     }
-  }.property("service.taskTrackers.length"),
+  }.property("service.taskTrackersTotal"),
 
   trackersSummary: function () {
     var svc = this.get('service');
-    var liveCount = svc.get('taskTrackers').filterProperty("workStatus", "STARTED").length;
-    var totalCount = svc.get('taskTrackers').get('length');
+    var liveCount = svc.get('taskTrackersStarted');
+    var totalCount = svc.get('taskTrackersTotal');
     var template = this.t('dashboard.services.mapreduce.trackersSummary');
     return template.format(liveCount, totalCount);
-  }.property('service.aliveTrackers.length', 'service.taskTrackers.@each.workStatus'),
-
-  trackersLiveTextView: App.ComponentLiveTextView.extend({
-    liveComponents: function () {
-      return this.get('service.taskTrackers').filterProperty("workStatus", "STARTED").get("length");
-    }.property("service.taskTrackers.@each.workStatus"),
-    totalComponents: function() {
-      return this.get("service.taskTrackers.length");
-    }.property('service.taskTrackers.length')
-  }),
+  }.property('service.taskTrackersTotal', 'service.taskTrackersStarted'),
 
   trackersHeapSummary: function () {
     var heapUsed = this.get('service').get('jobTrackerHeapUsed');
@@ -135,6 +126,9 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
   }.property('service.mapSlots', 'service.reduceSlots', 'service.aliveTrackers'),
 
   taskTrackerComponent: function () {
-    return this.get('service.taskTrackers').objectAt(0);
+    return Em.Object.create({
+      componentName: 'TASKTRACKER'
+    });
+    //return this.get('service.taskTrackers').objectAt(0);
   }.property()
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/services/storm.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/storm.js b/ambari-web/app/views/main/service/services/storm.js
index 906813d..937c856 100644
--- a/ambari-web/app/views/main/service/services/storm.js
+++ b/ambari-web/app/views/main/service/services/storm.js
@@ -23,19 +23,6 @@ App.MainDashboardServiceStormView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/service/services/storm'),
   serviceName: 'storm',
 
-  superVisorComponents: function() {
-    return this.get('service.hostComponents').filterProperty('componentName', 'SUPERVISOR');
-  }.property('service.hostComponents.@each'),
-
-  superVisorsLiveTextView: App.ComponentLiveTextView.extend({
-    liveComponents: function () {
-      return this.get('parentView.superVisorComponents').filterProperty('workStatus','STARTED').length;
-    }.property('parentView.superVisorComponents.@each.workStatus'),
-    totalComponents: function() {
-      return this.get('parentView.superVisorComponents').length;
-    }.property('parentView.superVisorComponents.length')
-  }),
-
   freeSlotsPercentage: function() {
     return Math.round(this.get('service.freeSlots')/this.get('service.totalSlots')*100);
   }.property('service.freeSlots', 'service.totalSlots'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/572e2a3c/ambari-web/app/views/main/service/services/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/yarn.js b/ambari-web/app/views/main/service/services/yarn.js
index b2dd7bc..a1ca107 100644
--- a/ambari-web/app/views/main/service/services/yarn.js
+++ b/ambari-web/app/views/main/service/services/yarn.js
@@ -35,13 +35,16 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
 
   summaryHeader: function () {
     var text = this.t("dashboard.services.yarn.summary");
-    var svc = this.get('service');
-    var totalCount = svc.get('nodeManagerNodes').get('length');
-    return text.format(totalCount, totalCount);
-  }.property('service.nodeManagerNodes'),
+    var totalCount = this.get('service.nodeManagersTotal');
+    var liveCount = this.get('service.nodeManagersStarted');
+    return text.format(liveCount, totalCount);
+  }.property('service.nodeManagersStarted', 'service.nodeManagersTotal'),
   
   nodeManagerComponent: function () {
-    return this.get('service.nodeManagerNodes').objectAt(0);
+    return Em.Object.create({
+      componentName: 'NODEMANAGER'
+    });
+    //return this.get('service.nodeManagerNodes').objectAt(0);
   }.property(),
   
   yarnClientComponent: function () {
@@ -66,23 +69,14 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
   }.property("service.resourceManagerStartTime"),
 
   nodeManagerText: function () {
-    if(!this.get("nodeManagerComponent") || this.get("nodeManagerComponent.length") == 0){
+    if (this.get("service.nodeManagersTotal") === 0) {
       return '';
-    } else if(this.get("nodeManagerComponent.length") > 1){
+    } else if (this.get("service.nodeManagersTotal") > 1) {
       return Em.I18n.t('services.service.summary.viewHosts');
     } else {
       return Em.I18n.t('services.service.summary.viewHost');
     }
-  }.property("nodeManagerComponent"),
-
-  nodeManagersLiveTextView: App.ComponentLiveTextView.extend({
-    liveComponents: function () {
-      return this.get('service.nodeManagerNodes').filterProperty("workStatus", "STARTED").get("length");
-    }.property("service.nodeManagerNodes.@each.workStatus"),
-    totalComponents: function () {
-      return this.get('service.nodeManagerNodes.length');
-    }.property("service.nodeManagerNodes.length")
-  }),
+  }.property("service.nodeManagersTotal"),
 
   nodeManagersStatus: function () {
     var nmActive = this.get('service.nodeManagersCountActive');


Mime
View raw message