ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [21/39] git commit: AMBARI-7220. Ambari NN HA wizard cannot detect checkpoint. (akovalenko)
Date Wed, 10 Sep 2014 13:03:33 GMT
AMBARI-7220. Ambari NN HA wizard cannot detect checkpoint. (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/245cf1ba
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/245cf1ba
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/245cf1ba

Branch: refs/heads/branch-alerts-dev
Commit: 245cf1bae02f2815cb71edf56902f6fafa47c03f
Parents: 8f287ce
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Tue Sep 9 17:09:26 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Tue Sep 9 17:11:12 2014 +0300

----------------------------------------------------------------------
 .../nameNode/step4_controller.js                | 29 ++++++++++++--------
 ambari-web/app/controllers/main/service/item.js |  6 ++--
 ambari-web/app/messages.js                      |  1 +
 .../admin/highAvailability/nameNode/step4.hbs   |  5 ++++
 4 files changed, 26 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/245cf1ba/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js
index 2fba24e..eb51423 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js
@@ -28,6 +28,8 @@ App.HighAvailabilityWizardStep4Controller = Em.Controller.extend({
 
   isNextEnabled: false,
 
+  isNameNodeStarted: true,
+
   pullCheckPointStatus: function () {
     var hostName = this.get('content.masterComponentHosts').findProperty('isCurNameNode',
true).hostName;
     App.ajax.send({
@@ -41,18 +43,23 @@ App.HighAvailabilityWizardStep4Controller = Em.Controller.extend({
   },
 
   checkNnCheckPointStatus: function (data) {
-    var self = this;
-    var journalTransactionInfo =  $.parseJSON(data.metrics.dfs.namenode.JournalTransactionInfo);
-    var isInSafeMode = (data.metrics.dfs.namenode.Safemode != "");
-    journalTransactionInfo = parseInt(journalTransactionInfo.LastAppliedOrWrittenTxId) -
parseInt(journalTransactionInfo.MostRecentCheckpointTxId);
-    if(journalTransactionInfo <= 1 && isInSafeMode){
-      this.set("isNextEnabled", true);
-      return;
-    }
+    if (data.HostRoles.desired_state === 'STARTED') {
+      this.set('isNameNodeStarted', true);
+      var self = this;
+      var journalTransactionInfo = $.parseJSON(data.metrics.dfs.namenode.JournalTransactionInfo);
+      var isInSafeMode = (data.metrics.dfs.namenode.Safemode != "");
+      journalTransactionInfo = parseInt(journalTransactionInfo.LastAppliedOrWrittenTxId)
- parseInt(journalTransactionInfo.MostRecentCheckpointTxId);
+      if (journalTransactionInfo <= 1 && isInSafeMode) {
+        this.set("isNextEnabled", true);
+        return;
+      }
 
-    window.setTimeout(function () {
-      self.pullCheckPointStatus()
-    }, self.POLL_INTERVAL);
+      window.setTimeout(function () {
+        self.pullCheckPointStatus()
+      }, self.POLL_INTERVAL);
+    } else {
+      this.set('isNameNodeStarted', false);
+    }
   },
 
   done: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/245cf1ba/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 5593c72..fc62a4e 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -163,9 +163,9 @@ App.MainServiceItemController = Em.Controller.extend({
 
   startStopPopupPrimary: function (serviceHealth, query, runMmOperation) {
     var requestInfo = "";
-    var turnOnMM = "ON"
+    var turnOnMM = "ON";
     if (serviceHealth == "STARTED") {
-      turnOnMM = "OFF"
+      turnOnMM = "OFF";
       requestInfo = App.BackgroundOperationsController.CommandContexts.START_SERVICE.format(this.get('content.serviceName'));
     } else {
       requestInfo = App.BackgroundOperationsController.CommandContexts.STOP_SERVICE.format(this.get('content.serviceName'));
@@ -189,8 +189,6 @@ App.MainServiceItemController = Em.Controller.extend({
       'error': 'startStopPopupErrorCallback',
       'data': data
     });
-    this.set('isStopDisabled', true);
-    this.set('isStartDisabled', true);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/245cf1ba/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9f9474a..f158f8d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -883,6 +883,7 @@ Em.I18n.translations = {
   'admin.highAvailability.wizard.step2.header':'Select Hosts',
   'admin.highAvailability.wizard.step3.header':'Review',
   'admin.highAvailability.wizard.step4.header':'Create Checkpoint',
+  'admin.highAvailability.wizard.step4.error.nameNode':'NameNode is not started. Please quit
wizard and start NameNode first.',
   'admin.highAvailability.wizard.step5.header':'Configure Components',
   'admin.highAvailability.wizard.step6.header':'Initialize JournalNodes',
   'admin.highAvailability.wizard.step7.header':'Start Components',

http://git-wip-us.apache.org/repos/asf/ambari/blob/245cf1ba/ambari-web/app/templates/main/admin/highAvailability/nameNode/step4.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/nameNode/step4.hbs b/ambari-web/app/templates/main/admin/highAvailability/nameNode/step4.hbs
index ae9090e..43b7058 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/nameNode/step4.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/nameNode/step4.hbs
@@ -17,6 +17,11 @@
 }}
 <div id="ha-step4">
   <h2>{{t admin.highAvailability.wizard.step4.bodyHeader}}</h2>
+  {{#unless controller.isNameNodeStarted}}
+    <div class="alert alert-error">
+      {{t admin.highAvailability.wizard.step4.error.nameNode}}
+    </div>
+  {{/unless}}
   <div class="alert alert-info">
     {{{view.step4BodyText}}}
   </div>


Mime
View raw message