Browse Source

AMBARI-6075 YARN summary shows 0 clients installed. (atkach)

atkach 11 years ago
parent
commit
6ae52ba4bf

+ 0 - 3
ambari-web/app/models/service/yarn.js

@@ -47,9 +47,6 @@ App.YARNService = App.Service.extend({
     }
     }
     return "8188";
     return "8188";
   }.property(),
   }.property(),
-  yarnClientNodes: function(){
-    return this.get('hostComponents').filterProperty('componentName', 'YARN_CLIENT').mapProperty('host');
-  }.property('hostComponents.length'),
   resourceManagerStartTime: DS.attr('number'),
   resourceManagerStartTime: DS.attr('number'),
   jvmMemoryHeapUsed: DS.attr('number'),
   jvmMemoryHeapUsed: DS.attr('number'),
   jvmMemoryHeapMax: DS.attr('number'),
   jvmMemoryHeapMax: DS.attr('number'),

+ 3 - 3
ambari-web/app/templates/main/service/services/yarn.hbs

@@ -31,11 +31,11 @@
 <!-- YARN Clients -->
 <!-- YARN Clients -->
 <tr>
 <tr>
   <td class="summary-label"><a {{action filterHosts view.yarnClientComponent}}
   <td class="summary-label"><a {{action filterHosts view.yarnClientComponent}}
-      href="javascript:void(null)">{{pluralize view.service.yarnClientNodes.length singular="t:dashboard.services.yarn.client" plural="t:dashboard.services.yarn.clients"}}</a>
+      href="javascript:void(null)">{{pluralize view.service.installedClients singular="t:dashboard.services.yarn.client" plural="t:dashboard.services.yarn.clients"}}</a>
   </td>
   </td>
   <td>
   <td>
-    <span class="green-live">{{view.service.yarnClientNodes.length}} </span>
-    {{pluralize view.service.yarnClientNodes.length singular="t:dashboard.services.yarn.client" plural="t:dashboard.services.yarn.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>
+    {{pluralize view.service.installedClients singular="t:dashboard.services.yarn.client" plural="t:dashboard.services.yarn.clients"}} {{t common.installed}}
   </td>
   </td>
 </tr>
 </tr>
 <!-- ResourceManager Uptime -->
 <!-- ResourceManager Uptime -->

+ 6 - 3
ambari-web/app/views/main/service/services/yarn.js

@@ -48,12 +48,15 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
   }.property(),
   }.property(),
   
   
   yarnClientComponent: function () {
   yarnClientComponent: function () {
-    return this.get('service.hostComponents').findProperty('componentName', 'YARN_CLIENT');
+    return Em.Object.create({
+      componentName: 'YARN_CLIENT'
+    });
+    //return this.get('service.hostComponents').findProperty('componentName', 'YARN_CLIENT');
   }.property(),
   }.property(),
 
 
   hasManyYarnClients: function () {
   hasManyYarnClients: function () {
-    return (this.get('service.yarnClientNodes.length') > 1);
-  }.property('service.yarnClientNodes.length'),
+    return (this.get('service.installedClients') > 1);
+  }.property('service.installedClients'),
 
 
   nodeUptime: function () {
   nodeUptime: function () {
     var uptime = this.get('service').get('resourceManagerStartTime');
     var uptime = this.get('service').get('resourceManagerStartTime');

+ 0 - 17
ambari-web/test/models/service/yarn_test.js

@@ -57,12 +57,6 @@ var yarnService,
       type: 'yarn-site'
       type: 'yarn-site'
     }
     }
   ],
   ],
-  nodeCases = [
-    {
-      propertyName: 'yarnClientNodes',
-      componentId: 'host'
-    }
-  ],
   nodeCountCases = [
   nodeCountCases = [
     {
     {
       assets: {
       assets: {
@@ -114,17 +108,6 @@ describe('App.YARNService', function () {
     });
     });
   });
   });
 
 
-  nodeCases.forEach(function (item) {
-    var propertyName = item.propertyName;
-    describe('#' + propertyName, function () {
-      it('should take one component from hostComponents', function () {
-        setHostComponents();
-        expect(yarnService.get(propertyName)).to.have.length(1);
-        expect(yarnService.get(propertyName)[0].id).to.equal(item.componentId);
-      });
-    });
-  });
-
   describe('#ahsWebPort', function () {
   describe('#ahsWebPort', function () {
 
 
     afterEach(function () {
     afterEach(function () {