incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1478194 - in /incubator/ambari/trunk: ./ ambari-web/app/ ambari-web/app/assets/data/dashboard/ ambari-web/app/controllers/main/host/ ambari-web/app/templates/main/host/ ambari-web/app/views/main/host/
Date Wed, 01 May 2013 21:17:56 GMT
Author: yusaku
Date: Wed May  1 21:17:56 2013
New Revision: 1478194

URL: http://svn.apache.org/r1478194
Log:
AMBARI-2058. Host Detail page: if the host component is in INSTALL_FAILED state, we should
let the user reinstall it. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/assets/data/dashboard/services.json
    incubator/ambari/trunk/ambari-web/app/controllers/main/host/details.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/templates/main/host/summary.hbs
    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=1478194&r1=1478193&r2=1478194&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed May  1 21:17:56 2013
@@ -823,6 +823,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2058. Host Detail page: if the host component is in INSTALL_FAILED
+ state, we should let the user reinstall it. (yusaku)
+
  AMBARI-2055. Oozie reconfig forces the user to enter bogus values for two
  parameters in order to save any changes. (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/assets/data/dashboard/services.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/dashboard/services.json?rev=1478194&r1=1478193&r2=1478194&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/dashboard/services.json (original)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/dashboard/services.json Wed May  1 21:17:56
2013
@@ -28,7 +28,7 @@
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_state" : "INSTALLED",
-                "state" : "STARTED",
+                "state" : "INSTALL_FAILED",
                 "component_name" : "HBASE_REGIONSERVER",
                 "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
               }
@@ -743,22 +743,6 @@
               }
             },
             {
-              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/TASKTRACKER",
-              "HostRoles" : {
-                "configs" : {
-                  "mapred-site" : "version1",
-                  "global" : "version1",
-                  "core-site" : "version1"
-                },
-                "cluster_name" : "cl1",
-                "desired_configs" : { },
-                "desired_state" : "STARTED",
-                "state" : "STARTED",
-                "component_name" : "TASKTRACKER",
-                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
-              }
-            },
-            {
               "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/TASKTRACKER",
               "HostRoles" : {
                 "configs" : {

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/host/details.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/host/details.js?rev=1478194&r1=1478193&r2=1478194&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/host/details.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/host/details.js Wed May  1 21:17:56
2013
@@ -283,6 +283,61 @@ App.MainHostDetailsController = Em.Contr
     });
   },
   /**
+   * send command to server to install selected host component
+   * @param event
+   * @param context
+   */
+  installComponent: function (event, context) {
+    var self = this;
+    var component = event.context;
+    var componentName = component.get('componentName').toUpperCase().toString();
+
+    App.ModalPopup.show({
+      primary: Em.I18n.t('yes'),
+      secondary: Em.I18n.t('no'),
+      header: Em.I18n.t('popup.confirmation.commonHeader'),
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile([
+          '{{t hosts.delete.popup.body}}<br /><br />',
+          '{{t hosts.host.addComponent.note}}'
+        ].join(''))
+      }),
+      onPrimary: function () {
+        this.hide();
+        self.sendCommandToServer('/hosts/' + self.get('content.hostName') + '/host_components/'
+ component.get('componentName').toUpperCase(), {
+            RequestInfo: {
+              "context": Em.I18n.t('requestInfo.installHostComponent') + " " + componentName
+            },
+            Body: {
+              HostRoles: {
+                state: 'INSTALLED'
+              }
+            }
+          },
+          'PUT',
+          function (requestId) {
+            if (!requestId) {
+              return;
+            }
+
+            console.log('Send request for REINSTALL COMPONENT successfully');
+
+            if (App.testMode) {
+              component.set('workStatus', App.HostComponentStatus.installing);
+              setTimeout(function () {
+                component.set('workStatus', App.HostComponentStatus.stopped);
+              }, App.testModeDelayForActions);
+            } else {
+              App.router.get('clusterController').loadUpdatedStatusDelayed(500);
+            }
+
+            App.router.get('backgroundOperationsController').showPopup();
+
+          });
+      }
+    });
+  },
+  /**
    * send command to server to run decommission on DATANODE
    * @param event
    */

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1478194&r1=1478193&r2=1478194&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Wed May  1 21:17:56 2013
@@ -128,6 +128,7 @@ Em.I18n.translations = {
   'common.abort': 'Abort',
   'common.misc': 'Misc',
   'common.operations': 'Operations',
+  'common.install': 'Install',
 
   'requestInfo.installComponents':'Install Components',
   'requestInfo.installServices':'Install Services',

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/host/summary.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/host/summary.hbs?rev=1478194&r1=1478193&r2=1478194&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/host/summary.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/host/summary.hbs Wed May  1 21:17:56
2013
@@ -86,7 +86,7 @@
                       {{t common.stop}}
                     </a>
                   </li>
-                  <li {{bindAttr class="view.isStart:hidden:"}}>
+                  <li {{bindAttr class="view.isStart:hidden: view.isInstallFailed:hidden"}}>
                     <a href="javascript:void(null)" data-toggle="modal" {{action "startComponent"
view.content target="controller"}}>
                       {{t common.start}}
                     </a>
@@ -96,6 +96,11 @@
                       {{t common.upgrade}}
                     </a>
                   </li>
+                  <li {{bindAttr class="view.isInstallFailed::hidden"}}>
+                    <a href="javascript:void(null)" data-toggle="modal" {{action "installComponent"
view.content target="controller"}}>
+                      {{t common.install}}
+                    </a>
+                  </li>
                 </ul>
               </div>
               {{/if}}

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=1478194&r1=1478193&r2=1478194&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 Wed May  1 21:17:56 2013
@@ -197,17 +197,22 @@ App.MainHostSummaryView = Em.View.extend
           return 'health-status-DEAD-ORANGE';
         }
       }
+      if(this.get('workStatus') === App.HostComponentStatus.install_failed){
+        return 'icon-remove';
+      }
       return 'health-status-' + App.HostComponentStatus.getKeyName(this.get('workStatus'));
     }.property('workStatus', 'isDataNodeRecommissionAvailable'),
     /**
      * For Upgrade failed state
      */
     isUpgradeFailed:function(){
-      if(App.HostComponentStatus.getKeyName(this.get('workStatus')) == "upgrade_failed"){
-        return true;
-      }else{
-        return false;
-      }
+      return App.HostComponentStatus.getKeyName(this.get('workStatus')) === "upgrade_failed";
+    }.property("workStatus"),
+    /**
+     * For Install failed state
+     */
+    isInstallFailed:function(){
+      return App.HostComponentStatus.getKeyName(this.get('workStatus')) === "install_failed";
     }.property("workStatus"),
     /**
      * Disable element while component is starting/stopping



Mime
View raw message