You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/04/27 05:17:53 UTC

svn commit: r1476478 - in /incubator/ambari/trunk: ./ ambari-web/app/models/ ambari-web/app/styles/ ambari-web/app/views/main/dashboard/ ambari-web/app/views/main/host/

Author: yusaku
Date: Sat Apr 27 03:17:53 2013
New Revision: 1476478

URL: http://svn.apache.org/r1476478
Log:
AMBARI-2030. Make frontend changes to account for the host component status UNKNOWN. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/models/host.js
    incubator/ambari/trunk/ambari-web/app/models/host_component.js
    incubator/ambari/trunk/ambari-web/app/models/service.js
    incubator/ambari/trunk/ambari-web/app/styles/application.less
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
    incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Sat Apr 27 03:17:53 2013
@@ -269,6 +269,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-2030. Make frontend changes to account for the host component status
+ UNKNOWN. (yusaku)
+
  AMBARI-2028. Customize Services: make the services display consistent.
  (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/models/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/host.js?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/host.js Sat Apr 27 03:17:53 2013
@@ -110,9 +110,9 @@ App.Host = DS.Model.extend({
     return misc.formatBandwidth(this.get('memory') * 1024);
   }.property('memory'),
   /**
-   * Return true if host not heartbeating last 180 seconds
+   * Return true if the host has not sent heartbeat within the last 180 seconds
    */
-  isNotHeartBeating : function(){
+  isNotHeartBeating : function() {
     return (App.testMode) ? false : ((new Date()).getTime() - this.get('lastHeartBeatTime')) > 180 * 1000;
   }.property('lastHeartBeatTime'),
 
@@ -146,7 +146,7 @@ App.Host = DS.Model.extend({
       var masterComponentsRunning = masterComponents.everyProperty('workStatus', App.HostComponentStatus.started);
       var slaveComponents = this.get('hostComponents').filterProperty('isSlave');
       var slaveComponentsRunning = slaveComponents.everyProperty('workStatus', App.HostComponentStatus.started);
-      if (this.get('isNotHeartBeating')) {
+      if (this.get('isNotHeartBeating') || healthStatus == 'UNKNOWN') {
         status = 'DEAD-YELLOW';
       } else if (masterComponentsRunning && slaveComponentsRunning) {
         status = 'LIVE';

Modified: incubator/ambari/trunk/ambari-web/app/models/host_component.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/host_component.js?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/host_component.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/host_component.js Sat Apr 27 03:17:53 2013
@@ -102,6 +102,7 @@ App.HostComponentStatus = {
   install_failed: "INSTALL_FAILED",
   installing: "INSTALLING",
   upgrade_failed: "UPGRADE_FAILED",
+  unknown: "UNKNOWN",
 
   getKeyName:function(value){
     switch(value){
@@ -123,6 +124,8 @@ App.HostComponentStatus = {
         return 'installing';
       case this.upgrade_failed:
         return 'upgrade_failed';
+      case this.unknown:
+        return 'unknown';
     }
     return 'none';
   }

Modified: incubator/ambari/trunk/ambari-web/app/models/service.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/service.js?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/service.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/service.js Sat Apr 27 03:17:53 2013
@@ -50,7 +50,7 @@ App.Service = DS.Model.extend({
     var components = this.get('hostComponents').filterProperty('isMaster', true);
     var isGreen = (this.get('serviceName') === 'HBASE' && App.supports.multipleHBaseMasters ?
       components.someProperty('workStatus', App.HostComponentStatus.started) :
-      components.everyProperty('workStatus', App.HostComponentStatus.started)) ;
+      components.everyProperty('workStatus', App.HostComponentStatus.started));
 
     if (isGreen) {
       this.set('healthStatus', 'green');
@@ -58,6 +58,8 @@ App.Service = DS.Model.extend({
       this.set('healthStatus', 'green-blinking');
     } else if (components.someProperty('workStatus', App.HostComponentStatus.stopped) || components.someProperty('workStatus', App.HostComponentStatus.start_failed)) {
       this.set('healthStatus', 'red');
+    } else if (components.someProperty('workStatus', App.HostComponentStatus.unknown)) {
+      this.set('healthStatus', 'yellow');
     } else {
       this.set('healthStatus', 'red-blinking');
     }
@@ -245,6 +247,7 @@ App.Service.Health = {
   dead: "DEAD-RED",
   starting: "STARTING",
   stopping: "STOPPING",
+  unknown: "DEAD-YELLOW",
 
   getKeyName: function (value) {
     switch (value) {
@@ -256,6 +259,8 @@ App.Service.Health = {
         return 'starting';
       case this.stopping:
         return 'stopping';
+      case this.unknown:
+        return 'unknown';
     }
     return 'none';
   }

Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Sat Apr 27 03:17:53 2013
@@ -1675,8 +1675,9 @@ a:focus {
       .tab-marker-position;
       background-image: @status-dead-red-marker;
     }
-    .health-status-undefined {
+    .health-status-DEAD-YELLOW {
       .tab-marker-position;
+      background-image: @status-dead-yellow-marker;
     }
     li {
       line-height: 24px;
@@ -2136,6 +2137,11 @@ table.graphs {
     .marker;
   }
 
+  .health-status-unknown {
+    background-image: @status-dead-yellow-marker;
+    .marker;
+  }
+
   .health-status-LIVE {
     background-image: @status-live-marker;
     .marker;

Modified: incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js Sat Apr 27 03:17:53 2013
@@ -65,6 +65,9 @@ App.MainDashboardServiceHealthView = Em.
         status = App.Service.Health.dead;
         this.startBlink();
         break;
+      case 'yellow':
+        status = App.Service.Health.unknown;
+        break;
       default:
         status = App.Service.Health.dead;
         this.stopBlink();

Modified: incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js?rev=1476478&r1=1476477&r2=1476478&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js Sat Apr 27 03:17:53 2013
@@ -212,7 +212,7 @@ App.MainHostSummaryView = Em.View.extend
      */
     disabledClass:function(){
       var workStatus = this.get('workStatus');
-      if([App.HostComponentStatus.starting, App.HostComponentStatus.stopping].contains(workStatus) ){
+      if([App.HostComponentStatus.starting, App.HostComponentStatus.stopping, App.HostComponentStatus.unknown].contains(workStatus) ){
         return 'disabled';
       } else {
         return '';