Browse Source

AMBARI-1014. Hook service summary sections in service pages to API. (Srimanth Gunturi via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418946 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
6b5925ee37

+ 3 - 0
AMBARI-666-CHANGES.txt

@@ -12,6 +12,9 @@ AMBARI-666 branch (unreleased changes)
 
 
   NEW FEATURES
   NEW FEATURES
 
 
+  AMBARI-1014. Hook service summary sections in service pages to API.
+  (Srimanth Gunturi via yusaku)
+
   AMBARI-1008. Populate dashboard>MapReduce section with API data.
   AMBARI-1008. Populate dashboard>MapReduce section with API data.
   (Srimanth Gunturi via yusaku)
   (Srimanth Gunturi via yusaku)
 
 

+ 159 - 0
ambari-web/app/assets/data/dashboard/serviceComponents.json

@@ -0,0 +1,159 @@
+{
+  "href" : "http://ambari/api/clusters/vmc/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/ServiceComponentInfo",
+  "items" : [
+    {
+      "href" : "http://ambari/api/clusters/vmc/services/HDFS",
+      "ServiceInfo" : {
+        "cluster_name" : "vmc",
+        "service_name" : "HDFS"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/HDFS/components/DATANODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "DATANODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/HDFS/components/SECONDARY_NAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "SECONDARY_NAMENODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/HDFS/components/NAMENODE",
+          "ServiceComponentInfo" : {
+            "LiveNodes" : "{\"hostname\":{\"usedSpace\":200704,\"lastContact\":2}}",
+            "CapacityUsed" : 200704,
+            "component_name" : "NAMENODE",
+            "state" : "STARTED",
+            "HeapMemoryUsed" : 60622032,
+            "service_name" : "HDFS",
+            "UpgradeFinalized" : true,
+            "HeapMemoryMax" : 1006632960,
+            "cluster_name" : "vmc",
+            "DecomNodes" : "{}",
+            "Safemode" : "",
+            "desired_configs" : "{}",
+            "CapacityTotal" : 52844687359,
+            "StartTime" : 1352767879543,
+            "Version" : "1.1.0.1, r",
+            "DeadNodes" : "{}"
+          }
+        },
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/HDFS/components/HDFS_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "INSTALLED",
+            "component_name" : "HDFS_CLIENT",
+            "service_name" : "HDFS"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/api/clusters/vmc/services/NAGIOS",
+      "ServiceInfo" : {
+        "cluster_name" : "vmc",
+        "service_name" : "NAGIOS"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/NAGIOS/components/NAGIOS_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "NAGIOS_SERVER",
+            "service_name" : "NAGIOS"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/api/clusters/vmc/services/GANGLIA",
+      "ServiceInfo" : {
+        "cluster_name" : "vmc",
+        "service_name" : "GANGLIA"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/GANGLIA/components/GANGLIA_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "GANGLIA_SERVER",
+            "service_name" : "GANGLIA"
+          }
+        },
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/GANGLIA/components/GANGLIA_MONITOR",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "GANGLIA_MONITOR",
+            "service_name" : "GANGLIA"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/api/clusters/vmc/services/MAPREDUCE",
+      "ServiceInfo" : {
+        "cluster_name" : "vmc",
+        "service_name" : "MAPREDUCE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/MAPREDUCE/components/TASKTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "TASKTRACKER",
+            "service_name" : "MAPREDUCE"
+          }
+        },
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "INSTALLED",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "service_name" : "MAPREDUCE"
+          }
+        },
+        {
+          "href" : "http://ambari/api/clusters/vmc/services/MAPREDUCE/components/JOBTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "vmc",
+            "desired_configs" : "{}",
+            "state" : "STARTED",
+            "component_name" : "JOBTRACKER",
+            "HeapMemoryUsed" : 144639872,
+            "BlackListedNodes" : "[]",
+            "StartTime" : 1352768002344,
+            "service_name" : "MAPREDUCE",
+            "AliveNodes" : "[{\"hostname\":\"hostname\",\"last_seen\":1352854673780,\"health\":\"OK\",\"slots\":{\"map_slots\":4,\"map_slots_used\":0,\"reduce_slots\":2,\"reduce_slots_used\":0},\"failures\":0,\"dir_failures\":0}]",
+            "HeapMemoryMax" : 1052770304,
+            "Version" : "1.1.0.1, r",
+            "GrayListedNodes" : "[]"
+          }
+        }
+      ]
+    }
+  ]
+}

File diff suppressed because it is too large
+ 634 - 289
ambari-web/app/assets/data/dashboard/services.json


+ 1 - 1
ambari-web/app/controllers/global/cluster_controller.js

@@ -180,7 +180,7 @@ App.ClusterController = Em.Controller.extend({
      var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
      var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
      var hostsUrl = this.getUrl('/data/hosts/hosts.json', '/hosts?fields=*');
      var hostsUrl = this.getUrl('/data/hosts/hosts.json', '/hosts?fields=*');
      var servicesUrl1 = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*');
      var servicesUrl1 = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*');
-     var servicesUrl2 = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/ServiceComponentInfo');
+     var servicesUrl2 = this.getUrl('/data/dashboard/serviceComponents.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/ServiceComponentInfo');
      var usersUrl = App.testMode ? '/data/users/users.json' : '/api/users/?fields=*';
      var usersUrl = App.testMode ? '/data/users/users.json' : '/api/users/?fields=*';
      var runsUrl = App.testMode ? "/data/apps/runs.json" : "/api/jobhistory/workflow";
      var runsUrl = App.testMode ? "/data/apps/runs.json" : "/api/jobhistory/workflow";
 
 

+ 6 - 1
ambari-web/app/templates/main/dashboard/service/hdfs.hbs

@@ -16,6 +16,7 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
+{{#unless view.showOnlyRows}}
 <div class="clearfix">
 <div class="clearfix">
   <div class="name span2">
   <div class="name span2">
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
@@ -30,6 +31,7 @@
 </div>
 </div>
 <table class="table no-borders">
 <table class="table no-borders">
   <tbody>
   <tbody>
+{{/unless}}
 
 
   <!-- NameNode -->
   <!-- NameNode -->
   <tr>
   <tr>
@@ -118,10 +120,12 @@
     <td>{{t services.service.summary.safeModeStatus}}</td>
     <td>{{t services.service.summary.safeModeStatus}}</td>
     <td>{{view.service.safeModeStatus}}</td>
     <td>{{view.service.safeModeStatus}}</td>
   </tr>
   </tr>
+  
+{{#unless view.showOnlyRows}}
   </tbody>
   </tbody>
 </table>
 </table>
 <div class="dashboard-mini-chart">
 <div class="dashboard-mini-chart">
-  {{view view.Chart}}
+  {{view view.Chart serviceBinding="view.service"}}
   <div class="chartLabel">{{t dashboard.services.hdfs.chart.label}}</div>
   <div class="chartLabel">{{t dashboard.services.hdfs.chart.label}}</div>
   {{#if view.service.quickLinks.length}}
   {{#if view.service.quickLinks.length}}
     {{#view App.QuickViewLinks contentBinding="view.service"}}
     {{#view App.QuickViewLinks contentBinding="view.service"}}
@@ -139,3 +143,4 @@
     {{/view}}
     {{/view}}
   {{/if}}
   {{/if}}
 </div>
 </div>
+{{/unless}}

+ 5 - 1
ambari-web/app/templates/main/dashboard/service/mapreduce.hbs

@@ -16,6 +16,7 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
+{{#unless view.showOnlyRows}}
 <div class="clearfix">
 <div class="clearfix">
   <div class="name span2">
   <div class="name span2">
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
@@ -30,7 +31,7 @@
 </div>
 </div>
 <table class="table no-borders">
 <table class="table no-borders">
   <tbody>
   <tbody>
-
+{{/unless}}
   <!-- JobTracker -->
   <!-- JobTracker -->
   <tr>
   <tr>
     <td>{{t services.service.summary.jobTracker}}</td>
     <td>{{t services.service.summary.jobTracker}}</td>
@@ -106,6 +107,8 @@
     <td>{{t dashboard.services.mapreduce.tasks.reduces}}</td>
     <td>{{t dashboard.services.mapreduce.tasks.reduces}}</td>
     <td>{{view.reduceTasksSummary}}</td>
     <td>{{view.reduceTasksSummary}}</td>
   </tr>
   </tr>
+  
+{{#unless view.showOnlyRows}}
   </tbody>
   </tbody>
 </table>
 </table>
 <div class="dashboard-mini-chart">
 <div class="dashboard-mini-chart">
@@ -127,3 +130,4 @@
   {{/view}}
   {{/view}}
   {{/if}}
   {{/if}}
 </div>
 </div>
+{{/unless}}

+ 8 - 130
ambari-web/app/templates/main/service/info/summary.hbs

@@ -43,6 +43,8 @@
       {{#unless view.serviceStatus.oozie}}
       {{#unless view.serviceStatus.oozie}}
       {{#unless view.serviceStatus.hive}}
       {{#unless view.serviceStatus.hive}}
       {{#unless view.serviceStatus.zookeeper}}
       {{#unless view.serviceStatus.zookeeper}}
+      {{#unless view.serviceStatus.hdfs}}
+      {{#unless view.serviceStatus.mapreduce}}
       {{#each component in controller.content.components}}
       {{#each component in controller.content.components}}
       <tr>
       <tr>
         {{#if component.isMaster}}
         {{#if component.isMaster}}
@@ -57,137 +59,13 @@
       {{/unless}}
       {{/unless}}
       {{/unless}}
       {{/unless}}
       {{/unless}}
       {{/unless}}
+      {{/unless}}
+      {{/unless}}
       {{#if view.serviceStatus.hdfs}}
       {{#if view.serviceStatus.hdfs}}
-      <tr>
-        <td>{{t services.service.summary.version}}</td>
-        <td>{{view.attributes.version}}</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.nameNode}}</td>
-        <td><a {{bindAttr href="view.attributes.namenode_addr"}}>{{view.attributes.namenode_addr}}</a></td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.nameNodeUptime}}</td>
-        <td>{{view.attributes.start_time.d}}day {{view.attributes.start_time.h}}hr {{view.attributes.start_time.m}}min</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.nameNodeHeap}}</td>
-        <td>{{view.attributes.memory_heap_used}} / {{view.attributes.memory_heap_max}} ({{view.attributes.memory_heap_percent_used}}
-          used)
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.dataNodes}}</td>
-        <td>
-          <a href="javascript:void(null)">{{view.attributes.live_nodes}} live</a> / <a
-            href="javascript:void(null)">{{view.attributes.dead_nodes}} dead</a> / <a
-            href="javascript:void(null)">{{view.attributes.decommissioning_nodes}} decom</a>
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.diskCapacity}}</td>
-        <td>{{view.attributes.used_bytes}} / {{view.attributes.dfs_total_bytes}} ({{view.attributes.dfs_percent_disk_used}}
-          used)
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.blocksTotal}}</td>
-        <td>{{view.attributes.dfs_blocks_total}}</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.blockErrors}}</td>
-        <td>{{view.attributes.dfs_blocks_corrupt}} corr / {{view.attributes.dfs_blocks_missing}} miss
-          / {{view.attributes.dfs_blocks_underreplicated}} underrep
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.totalFiles}}</td>
-        <td>{{view.attributes.dfs_dirfiles_count}}</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.pendingUpgradeStatus}}</td>
-        <td>
-          {{#if view.attributes.pending_upgrades}}
-          Pending upgrade
-          {{else}}
-          No pending upgrade
-          {{/if}}
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.safeModeStatus}}</td>
-        <td>
-          {{#if view.attributes.safemode}}
-          In safe mode
-          {{else}}
-          Not in safe mode
-          {{/if}}
-        </td>
-      </tr>
+        {{view App.MainDashboardServiceHdfsView showOnlyRows=true serviceBinding="view.service"}}
       {{/if}}
       {{/if}}
       {{#if view.serviceStatus.mapreduce}}
       {{#if view.serviceStatus.mapreduce}}
-      <tr>
-        <td>{{t services.service.summary.version}}</td>
-        <td>{{view.attributes.version}}</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.jobTracker}}</td>
-        <td><a {{bindAttr href="view.attributes.jobtracker_addr"}}>{{view.attributes.jobtracker_addr}}</a></td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.jobTrackerUptime}}</td>
-        <td>{{view.attributes.start_time.d}}day {{view.attributes.start_time.h}}hr {{view.attributes.start_time.m}}min</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.trackersLiveTotal}}</td>
-        <td>
-          <a href="javascript:void(null)">{{view.attributes.trackers_live}} live</a>
-          / {{view.attributes.trackers_total}} total
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.trackersBlacklistGraylist}}</td>
-        <td>
-          <a href="javascript:void(null)">{{view.attributes.trackers_blacklisted}} blacklist</a> / <a
-            href="javascript:void(null)">{{view.attributes.trackers_graylisted}} graylist</a> / <a
-            href="javascript:void(null)">{{view.attributes.trackers_excluded}} excl.</a>
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.jobTrackerHeap}}</td>
-        <td>{{view.attributes.memory_heap_used}} / {{view.attributes.memory_heap_max}} ({{view.attributes.memory_heap_percent_used}}
-          used)
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.totalSlotsCapacity}}</td>
-        <td>{{view.attributes.map_task_capacity}} maps / {{view.attributes.reduce_task_capacity}} reduces
-          / {{view.attributes.average_node_capacity}} avg per node
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.totalJobs}}</td>
-        <td>{{view.attributes.job_total_submissions}} submitted / {{view.attributes.job_total_completions}}
-          completed
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.currentSlotUtiliMaps}}</td>
-        <td>{{view.attributes.occupied_map_slots}} occupied / {{view.attributes.reserved_map_slots}} reserved</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.currentSlotUtiliReduces}}</td>
-        <td>{{view.attributes.occupied_reduce_slots}} occupied / {{view.attributes.reserved_reduce_slots}} reserved
-        </td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.tasksMaps}}</td>
-        <td>{{view.attributes.running_map_tasks}} running / {{view.attributes.waiting_maps}} waiting</td>
-      </tr>
-      <tr>
-        <td>{{t services.service.summary.tasksReduces}}</td>
-        <td>{{view.attributes.running_reduce_tasks}} running / {{view.attributes.waiting_reduces}} waiting</td>
-      </tr>
+        {{view App.MainDashboardServiceMapreduceView showOnlyRows=true serviceBinding="view.service"}}
       {{/if}}
       {{/if}}
       {{#if view.serviceStatus.hbase}}
       {{#if view.serviceStatus.hbase}}
       <tr>
       <tr>
@@ -328,7 +206,7 @@
 	</div>
 	</div>
 </div>
 </div>
 </div>
 </div>
-{{#if view.attributes.metric_graph_views}}
+{{#if view.serviceMetricGraphs.length}}
 <div class="row-fluid">
 <div class="row-fluid">
   <div class="span12">
   <div class="span12">
     <div class="box">
     <div class="box">
@@ -337,7 +215,7 @@
       </div>
       </div>
       
       
       <div class="summary-metric-graphs row-fluid">
       <div class="summary-metric-graphs row-fluid">
-        {{#each graph in view.attributes.metric_graph_views}}
+        {{#each graph in view.serviceMetricGraphs}}
           <div class="span3">
           <div class="span3">
             {{view graph}}
             {{view graph}}
           </div> 
           </div> 

+ 7 - 0
ambari-web/app/views/main/dashboard/service.js

@@ -25,6 +25,13 @@ App.MainDashboardServiceHealthView = Em.View.extend({
   template: Em.Handlebars.compile(""),
   template: Em.Handlebars.compile(""),
   blink: false,
   blink: false,
   tagName: 'span',
   tagName: 'span',
+  
+  /**
+   * When set to true, extending classes should
+   * show only tabular rows as they will be 
+   * embedded into other tables.
+   */
+  showOnlyRows: false,
 
 
   status: function () {
   status: function () {
     return this.get('service.workStatus');
     return this.get('service.workStatus');

+ 3 - 2
ambari-web/app/views/main/dashboard/service/hdfs.js

@@ -23,9 +23,10 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   serviceName:'HDFS',
   serviceName:'HDFS',
 
 
   Chart:App.ChartPieView.extend({
   Chart:App.ChartPieView.extend({
+    service: null,
     data:function () {
     data:function () {
-      return [ this.get('_parentView.service.capacityUsed'), this.get('_parentView.service.capacityTotal') ];
-    }.property('_parentView.service')
+      return [ this.get('service.capacityUsed'), this.get('service.capacityTotal') ];
+    }.property('service')
   }),
   }),
 
 
   nodeUptime:function () {
   nodeUptime:function () {

+ 74 - 49
ambari-web/app/views/main/service/info/summary.js

@@ -37,7 +37,21 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     }
     }
   },
   },
   service: function () {
   service: function () {
-    return this.get('controller.content');
+    var svc = this.get('controller.content');
+    var svcName = svc.get('serviceName');
+    if(svcName){
+      switch (svcName.toLowerCase()) {
+        case 'hdfs':
+          svc = App.HDFSService.find().objectAt(0);
+          break;
+        case 'mapreduce':
+          svc = App.MapReduceService.find().objectAt(0);
+          break;
+        default:
+          break;
+      }
+    }
+    return svc;
   }.property('controller.content'),
   }.property('controller.content'),
 
 
   isHide: true,
   isHide: true,
@@ -58,6 +72,49 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   }.property('service'),
   }.property('service'),
 
 
   oldServiceName : '',
   oldServiceName : '',
+  
+  /**
+   * Contains graphs for this particular service
+   */
+  serviceMetricGraphs: function(){
+    var svcName = this.get('service.serviceName');
+    var graphs = [];
+    if(svcName){
+      switch (svcName.toLowerCase()) {
+        case 'hdfs':
+          graphs = [ App.ChartServiceMetricsHDFS_SpaceUtilization.extend(),
+                     App.ChartServiceMetricsHDFS_FileOperations.extend(), 
+                     App.ChartServiceMetricsHDFS_BlockStatus.extend(), 
+                     App.ChartServiceMetricsHDFS_IO.extend(), 
+                     App.ChartServiceMetricsHDFS_RPC.extend(), 
+                     App.ChartServiceMetricsHDFS_GC.extend(), 
+                     App.ChartServiceMetricsHDFS_JVMHeap.extend(), 
+                     App.ChartServiceMetricsHDFS_JVMThreads.extend()];
+          break;
+        case 'mapreduce':
+          graphs = [ App.ChartServiceMetricsMapReduce_JobsStatus.extend(), 
+                     App.ChartServiceMetricsMapReduce_JobsRunningWaiting.extend(), 
+                     App.ChartServiceMetricsMapReduce_MapSlots.extend(), 
+                     App.ChartServiceMetricsMapReduce_ReduceSlots.extend(), 
+                     App.ChartServiceMetricsMapReduce_GC.extend(), 
+                     App.ChartServiceMetricsMapReduce_RPC.extend(), 
+                     App.ChartServiceMetricsMapReduce_JVMHeap.extend(), 
+                     App.ChartServiceMetricsMapReduce_JVMThreads.extend()];
+          break;
+        case 'hbase':
+          graphs = [  App.ChartServiceMetricsHBASE_ClusterRequests.extend(),
+                      App.ChartServiceMetricsHBASE_RegionServerReadWriteRequests.extend(),
+                      App.ChartServiceMetricsHBASE_RegionServerRegions.extend(),
+                      App.ChartServiceMetricsHBASE_RegionServerQueueSize.extend(),
+                      App.ChartServiceMetricsHBASE_HlogSplitTime.extend(),
+                      App.ChartServiceMetricsHBASE_HlogSplitSize.extend()];
+          break;
+        default:
+          break;
+      }
+    }
+    return graphs;
+  }.property('service'),
 
 
   loadServiceSummary: function (serviceName) {
   loadServiceSummary: function (serviceName) {
 
 
@@ -84,56 +141,24 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     console.log('load ', serviceName, ' info');
     console.log('load ', serviceName, ' info');
     this.set('oldServiceName', serviceName);
     this.set('oldServiceName', serviceName);
     serviceName = serviceName.toLowerCase();
     serviceName = serviceName.toLowerCase();
-    jQuery.getJSON('data/services/summary/' + serviceName + '.json', function (data) {
-      if (data[serviceName]) {
-        var summary = data[serviceName];
-        if (serviceName == 'hdfs') {
-          summary['start_time'] = summary['start_time'].toDaysHoursMinutes();
-          summary['memory_heap_percent_used'] = summary['memory_heap_used'].countPercentageRatio(summary['memory_heap_max']);
-          summary['memory_heap_used'] = summary['memory_heap_used'].bytesToSize(2, 'parseFloat');
-          summary['memory_heap_max'] = summary['memory_heap_max'].bytesToSize(2, 'parseFloat');
-          summary['dfs_percent_disk_used'] = parseFloat((100 - summary['dfs_percent_remaining']).toFixed(2)) + "%";
-          summary['used_bytes'] = (summary['dfs_used_bytes'] + summary['nondfs_used_bytes']).bytesToSize(2, 'parseFloat');
-          summary['dfs_total_bytes'] = summary['dfs_total_bytes'].bytesToSize(2, 'parseFloat');
-          summary['metric_graph_views'] = [ App.ChartServiceMetricsHDFS_SpaceUtilization.extend(),
-                                            App.ChartServiceMetricsHDFS_FileOperations.extend(), 
-                                            App.ChartServiceMetricsHDFS_BlockStatus.extend(), 
-                                            App.ChartServiceMetricsHDFS_IO.extend(), 
-                                            App.ChartServiceMetricsHDFS_RPC.extend(), 
-                                            App.ChartServiceMetricsHDFS_GC.extend(), 
-                                            App.ChartServiceMetricsHDFS_JVMHeap.extend(), 
-                                            App.ChartServiceMetricsHDFS_JVMThreads.extend()];
-        } else if (serviceName == 'mapreduce') {
-          summary['start_time'] = summary['start_time'].toDaysHoursMinutes();
-          summary['memory_heap_percent_used'] = summary['memory_heap_used'].countPercentageRatio(summary['memory_heap_max']);
-          summary['memory_heap_used'] = summary['memory_heap_used'].bytesToSize(2, 'parseFloat');
-          summary['memory_heap_max'] = summary['memory_heap_max'].bytesToSize(2, 'parseFloat');
-          summary['metric_graph_views'] = [ App.ChartServiceMetricsMapReduce_JobsStatus.extend(), 
-                                            App.ChartServiceMetricsMapReduce_JobsRunningWaiting.extend(), 
-                                            App.ChartServiceMetricsMapReduce_MapSlots.extend(), 
-                                            App.ChartServiceMetricsMapReduce_ReduceSlots.extend(), 
-                                            App.ChartServiceMetricsMapReduce_GC.extend(), 
-                                            App.ChartServiceMetricsMapReduce_RPC.extend(), 
-                                            App.ChartServiceMetricsMapReduce_JVMHeap.extend(), 
-                                            App.ChartServiceMetricsMapReduce_JVMThreads.extend()];
-        } else if (serviceName == 'hbase') {
-          summary['memory_heap_percent_used'] = summary['memory_heap_used'].countPercentageRatio(summary['memory_heap_max']);
-          summary['memory_heap_used'] = summary['memory_heap_used'].bytesToSize(2, 'parseFloat');
-          summary['memory_heap_max'] = summary['memory_heap_max'].bytesToSize(2, 'parseFloat');
-          summary['start_time'] = summary['start_time'].toDaysHoursMinutes();
-          summary['active_time'] = summary['active_time'].toDaysHoursMinutes();
-          summary['metric_graph_views'] = [ App.ChartServiceMetricsHBASE_ClusterRequests.extend(),
-                                            App.ChartServiceMetricsHBASE_RegionServerReadWriteRequests.extend(),
-                                            App.ChartServiceMetricsHBASE_RegionServerRegions.extend(),
-                                            App.ChartServiceMetricsHBASE_RegionServerQueueSize.extend(),
-                                            App.ChartServiceMetricsHBASE_HlogSplitTime.extend(),
-                                            App.ChartServiceMetricsHBASE_HlogSplitSize.extend()
-                                            ];
+    if(serviceName=='hbase'){
+      jQuery.getJSON('data/services/summary/' + serviceName + '.json', function (data) {
+        if (data[serviceName]) {
+          var summary = data[serviceName];
+          if (serviceName == 'hbase') {
+            summary['memory_heap_percent_used'] = summary['memory_heap_used'].countPercentageRatio(summary['memory_heap_max']);
+            summary['memory_heap_used'] = summary['memory_heap_used'].bytesToSize(2, 'parseFloat');
+            summary['memory_heap_max'] = summary['memory_heap_max'].bytesToSize(2, 'parseFloat');
+            summary['start_time'] = summary['start_time'].toDaysHoursMinutes();
+            summary['active_time'] = summary['active_time'].toDaysHoursMinutes();
+          }
+          summaryView.set('attributes', summary);
         }
         }
-        summaryView.set('attributes', summary);
-      }
-    })
+      })
+    }
   }.observes('serviceName'),
   }.observes('serviceName'),
+  
+  
 
 
   didInsertElement: function () {
   didInsertElement: function () {
     // We have to make the height of the Alerts section
     // We have to make the height of the Alerts section

Some files were not shown because too many files changed in this diff