You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2015/09/05 00:50:26 UTC

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

Repository: ambari
Updated Branches:
  refs/heads/trunk 55193c8fa -> 9bc3440a4


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/9bc3440a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9bc3440a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9bc3440a

Branch: refs/heads/trunk
Commit: 9bc3440a4ba35f1209d6170d62bfdded2c3b6f7c
Parents: 55193c8
Author: Xi Wang <xi...@apache.org>
Authored: Fri Sep 4 14:08:52 2015 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Fri Sep 4 15:49:53 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/9bc3440a/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/9bc3440a/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 bd3195f..0ea09c1 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/9bc3440a/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/9bc3440a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index ebc13a3..9ef3f7f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1813,9 +1813,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',