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/23 00:53:38 UTC

ambari git commit: AMBARI-12591-2. Prompt user to save checkpoint before shutdown if last checkpoint is too old.(XIWANG)

Repository: ambari
Updated Branches:
  refs/heads/trunk 0b2c1822d -> 38230dddd


AMBARI-12591-2. Prompt user to save checkpoint before shutdown if last checkpoint is too old.(XIWANG)


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

Branch: refs/heads/trunk
Commit: 38230dddd5cd607a35564bb46a0c56f53c44b360
Parents: 0b2c182
Author: Xi Wang <xi...@apache.org>
Authored: Tue Sep 22 15:44:05 2015 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Tue Sep 22 15:53:48 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/config.js                        | 3 ++-
 ambari-web/app/controllers/main/host/details.js | 4 ++--
 ambari-web/app/controllers/main/service/item.js | 2 +-
 ambari-web/app/messages.js                      | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/38230ddd/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 3216b11..ff35875 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -41,7 +41,8 @@ App.hostStatusCountersUpdateInterval = 10000;
 App.alertDefinitionsUpdateInterval = 10000;
 App.alertInstancesUpdateInterval = 10000;
 App.alertGroupsUpdateInterval = 10000;
-App.pageReloadTime=3600000;
+App.pageReloadTime = 3600000;
+App.nnCheckpointAgeAlertThreshold = 12; // in hours
 App.singleNodeInstall = false;
 App.singleNodeAlias = document.location.hostname;
 App.minDiskSpace = 2.0; // minimum disk space required for '/' for each host before install, unit GB

http://git-wip-us.apache.org/repos/asf/ambari/blob/38230ddd/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 e4b27c6..5181b8a 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -222,7 +222,7 @@ App.MainHostDetailsController = Em.Controller.extend({
         // too old
         self.getHdfsUser().done(function() {
           var msg = Em.Object.create({
-            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld') +
+            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld').format(App.nnCheckpointAgeAlertThreshold) +
               Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld, self.get('content.hdfsUser')),
             confirmButton: Em.I18n.t('common.next')
           });
@@ -260,7 +260,7 @@ App.MainHostDetailsController = Em.Controller.extend({
       if (!lastCheckpointTime) {
         this.set("isNNCheckpointTooOld", null);
       } else {
-        var time_criteria = 12; // time in hours to define how many hours ago is too old
+        var time_criteria = App.nnCheckpointAgeAlertThreshold; // time in hours to define how many hours ago is too old
         var time_ago = (Math.round(App.dateTime() / 1000) - (time_criteria * 3600)) *1000;
         if (lastCheckpointTime <= time_ago) {
           // too old, set the effected hostName

http://git-wip-us.apache.org/repos/asf/ambari/blob/38230ddd/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 99c2061..f9bc8cf 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -202,7 +202,7 @@ App.MainServiceItemController = Em.Controller.extend({
         // too old
         self.getHdfsUser().done(function() {
           var msg = Em.Object.create({
-            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld') +
+            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld').format(App.nnCheckpointAgeAlertThreshold) +
               Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld, self.get('content.hdfsUser')),
             confirmButton: Em.I18n.t('common.next')
           });

http://git-wip-us.apache.org/repos/asf/ambari/blob/38230ddd/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 3a188ec..615f3e4 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1815,7 +1815,7 @@ Em.I18n.translations = {
     '<li>Once in Safe Mode, create a Checkpoint:' +
     '<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.stop.HDFS.warningMsg.checkPointTooOld': 'The last HDFS checkpoint is older than {0} 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',
   'services.service.config_groups_popup.notice':'You can apply different sets of {{serviceName}} configurations to groups of hosts by managing {{serviceName}} Configuration Groups and their host membership.  Hosts belonging to a {{serviceName}} Configuration Group have the same set of configurations for {{serviceName}}. Each host belongs to one {{serviceName}} Configuration Group.',
   'services.service.config_groups_popup.rename':'Rename',