Prechádzať zdrojové kódy

AMBARI-4060. HDFS/JournalNodes relations in EmberData. (srimanth)

Srimanth Gunturi 11 rokov pred
rodič
commit
7f92051d01

+ 1 - 0
ambari-web/app/mappers/server_data_mapper.js

@@ -153,6 +153,7 @@ App.QuickDataMapper.componentServiceMap = {
   'SECONDARY_NAMENODE': 'HDFS',
   'DATANODE': 'HDFS',
   'HDFS_CLIENT': 'HDFS',
+  'JOURNALNODE': 'HDFS',
   'JOBTRACKER': 'MAPREDUCE',
   'TASKTRACKER': 'MAPREDUCE',
   'MAPREDUCE_CLIENT': 'MAPREDUCE',

+ 0 - 1
ambari-web/app/models/service/hdfs.js

@@ -27,7 +27,6 @@ App.HDFSService = App.Service.extend({
   dataNodes: function(){
     return this.get('hostComponents').filterProperty('componentName', 'DATANODE').mapProperty('host');
   }.property('hostComponents.length'),
-  journalNodes: DS.hasMany('App.Host'),
   nameNodeStartTime: DS.attr('number'),
   jvmMemoryHeapUsed: DS.attr('number'),
   jvmMemoryHeapMax: DS.attr('number'),

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

@@ -68,16 +68,6 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
     return App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').get('length') > 0;
   }.property('service.hostComponents.@each'),
 
-  journalNodeHostText: function () {
-    if (this.get("service.journalNodes").content.length == 0) {
-      return '';
-    } else if (this.get("service.journalNodes").content.length > 1){
-      return Em.I18n.t('services.service.summary.viewHosts');
-    }else{
-      return Em.I18n.t('services.service.summary.viewHost');
-    }
-  }.property("service"),
-
   dataNodesLiveTextView: App.ComponentLiveTextView.extend({
     liveComponents: function() {
       return App.HostComponent.find().filterProperty('componentName', 'DATANODE').filterProperty("workStatus","STARTED").get("length");
@@ -88,12 +78,15 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   }),
 
   journalNodesLiveTextView: App.ComponentLiveTextView.extend({
+    allJournalNodes: function () {
+      return App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE')
+    }.property('service.hostComponents.@each'),
     liveComponents: function() {
-      return App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').filterProperty("workStatus","STARTED").get("length");
-    }.property("service.hostComponents.@each"),
+      return this.get('allJournalNodes').filterProperty("workStatus","STARTED").get("length");
+    }.property("allJournalNodes"),
     totalComponents: function() {
-      return this.get("service.journalNodes.length");
-    }.property("service.journalNodes.length")
+      return this.get('allJournalNodes').get("length");
+    }.property("allJournalNodes")
   }),
 
   dfsTotalBlocks: function(){