ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-12967. Make HDFS username portion of the checkpoint command description dynamic.(xiwang)
Date Fri, 04 Sep 2015 22:52:20 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 2f13fc5e8 -> 07f9f7125


AMBARI-12967. Make HDFS username portion of the checkpoint command description dynamic.(xiwang)


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

Branch: refs/heads/branch-2.1
Commit: 07f9f712558d35e6d977ce33ba41133ff04c7765
Parents: 2f13fc5
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Sep 4 14:08:52 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Fri Sep 4 15:52:01 2015 -0700

----------------------------------------------------------------------
 .../main/admin/serviceAccounts_controller.js    |  2 +-
 ambari-web/app/controllers/main/host/details.js | 30 ++++++++++++++++----
 ambari-web/app/controllers/main/service/item.js | 30 ++++++++++++++++----
 ambari-web/app/messages.js                      |  4 +--
 4 files changed, 53 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/07f9f712/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
index 8629d67..645d7f4 100644
--- a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
+++ b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
@@ -49,7 +49,7 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
     var loadedClusterSiteToTagMap = {};
 
     for (var site in Em.get(data, 'Clusters.desired_configs')) {
-      if (serviceConfigsDef.configTypes.hasOwnProperty(site)) {
+      if (serviceConfigsDef.get('configTypes').hasOwnProperty(site)) {
         loadedClusterSiteToTagMap[site] = data.Clusters.desired_configs[site]['tag'];
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/07f9f712/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index d85587f..75937bf 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -191,6 +191,24 @@ App.MainHostDetailsController = Em.Controller.extend({
   },
 
   /**
+   * Return true if hdfs user data is loaded via App.MainServiceInfoConfigsController
+   */
+  getHdfsUser: function () {
+    var self = this;
+    var dfd = $.Deferred();
+    var miscController = App.MainAdminServiceAccountsController.create();
+    miscController.loadUsers();
+    var interval = setInterval(function () {
+      if (miscController.get('dataIsLoaded') && miscController.get('users')) {
+        self.set('content.hdfsUser', miscController.get('users').findProperty('name', 'hdfs_user').get('value'));
+        dfd.resolve();
+        clearInterval(interval);
+      }
+    }, 10);
+    return dfd.promise();
+  },
+
+  /**
    * this function will be called from :1) stop NN 2) restart NN 3) stop all components
    * @param callback - callback function to continue next operation
    * @param hostname - namenode host (by default is current host)
@@ -202,12 +220,14 @@ App.MainHostDetailsController = Em.Controller.extend({
       self.set('isNNCheckpointTooOld', null);
       if (isNNCheckpointTooOld) {
         // too old
-        var msg = Em.Object.create({
-          confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld')
+
-            Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld),
-          confirmButton: Em.I18n.t('common.next')
+        self.getHdfsUser().done(function() {
+          var msg = Em.Object.create({
+            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld')
+
+              Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld,
self.get('content.hdfsUser')),
+            confirmButton: Em.I18n.t('common.next')
+          });
+          return App.showConfirmationFeedBackPopup(callback, msg);
         });
-        return App.showConfirmationFeedBackPopup(callback, msg);
       } else if (isNNCheckpointTooOld == null) {
         // not available
         return App.showConfirmationPopup(

http://git-wip-us.apache.org/repos/asf/ambari/blob/07f9f712/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 af6ca36..99c2061 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -200,12 +200,14 @@ App.MainServiceItemController = Em.Controller.extend({
       self.set('isNNCheckpointTooOld', null);
       if (isNNCheckpointTooOld) {
         // too old
-        var msg = Em.Object.create({
-          confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld')
+
-            Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld),
-          confirmButton: Em.I18n.t('common.next')
+        self.getHdfsUser().done(function() {
+          var msg = Em.Object.create({
+            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld')
+
+              Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld,
self.get('content.hdfsUser')),
+            confirmButton: Em.I18n.t('common.next')
+          });
+          return App.showConfirmationFeedBackPopup(callback, msg);
         });
-        return App.showConfirmationFeedBackPopup(callback, msg);
       } else if (isNNCheckpointTooOld == null) {
         // not available
         return App.showConfirmationPopup(
@@ -271,6 +273,24 @@ App.MainServiceItemController = Em.Controller.extend({
     }
   },
 
+  /**
+   * Return true if hdfs user data is loaded via App.MainServiceInfoConfigsController
+   */
+  getHdfsUser: function () {
+    var self = this;
+    var dfd = $.Deferred();
+    var miscController = App.MainAdminServiceAccountsController.create();
+    miscController.loadUsers();
+    var interval = setInterval(function () {
+      if (miscController.get('dataIsLoaded') && miscController.get('users')) {
+        self.set('content.hdfsUser', miscController.get('users').findProperty('name', 'hdfs_user').get('value'));
+        dfd.resolve();
+        clearInterval(interval);
+      }
+    }, 10);
+    return dfd.promise();
+  },
+
   addAdditionalWarningMessage: function(serviceHealth, msg, serviceDisplayName){
     var servicesAffectedDisplayNames = [];
     var servicesAffected = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/07f9f712/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d34485b..8f2972a 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1839,9 +1839,9 @@ Em.I18n.translations = {
     '<br><ol>' +
     '<li>Login to the NameNode host <b>{0}</b>.</li>' +
     '<li>Put the NameNode in Safe Mode (read-only mode):' +
-    '<div class="code-snippet">sudo su hdfs -l -c \'hdfs dfsadmin -safemode enter\'</div></li>'
+
+    '<div class="code-snippet">sudo su {1} -l -c \'hdfs dfsadmin -safemode enter\'</div></li>'
+
     '<li>Once in Safe Mode, create a Checkpoint:' +
-    '<div class="code-snippet">sudo su hdfs -l -c \'hdfs dfsadmin -saveNamespace\'</div></li>'
+
+    '<div class="code-snippet">sudo su {1} -l -c \'hdfs dfsadmin -saveNamespace\'</div></li>'
+
     '</ol>',
   'services.service.stop.HDFS.warningMsg.checkPointTooOld': 'The last HDFS checkpoint is
older than 12 hours. Make sure that you have taken a checkpoint before proceeding. Otherwise,
the NameNode(s) can take a very long time to start up.',
   'services.service.config_groups_popup.header':'Manage {0} Configuration Groups',


Mime
View raw message