ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject git commit: AMBARI-4984. Better messages needed for Tez DAG unavailability dialogs. (srimanth)
Date Fri, 07 Mar 2014 02:56:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 81c1a416c -> 5bf016242


AMBARI-4984. Better messages needed for Tez DAG unavailability dialogs. (srimanth)


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

Branch: refs/heads/trunk
Commit: 5bf016242257163d9c92beabd292192116d3869d
Parents: 81c1a41
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Thu Mar 6 18:41:53 2014 -0800
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Thu Mar 6 18:43:09 2014 -0800

----------------------------------------------------------------------
 .../main/jobs/hive_job_details_controller.js    | 22 ++++++++++--
 ambari-web/app/messages.js                      | 12 +++----
 ambari-web/app/utils/jobs.js                    | 37 +++++++++++++++-----
 3 files changed, 54 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5bf01624/ambari-web/app/controllers/main/jobs/hive_job_details_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/jobs/hive_job_details_controller.js b/ambari-web/app/controllers/main/jobs/hive_job_details_controller.js
index e04392f..5f4a81a 100644
--- a/ambari-web/app/controllers/main/jobs/hive_job_details_controller.js
+++ b/ambari-web/app/controllers/main/jobs/hive_job_details_controller.js
@@ -36,11 +36,29 @@ App.MainHiveJobDetailsController = Em.Controller.extend({
         jobsUtils.refreshJobDetails(content, function() {
           self.set('content', self.get('job'));
           self.set('loaded', true);
+        }, function(errorId) {
+          switch (errorId) {
+          case 'job.dag.noId':
+            App.showAlertPopup(Em.I18n.t('jobs.hive.tez.dag.error.noDagId.title'), Em.I18n.t('jobs.hive.tez.dag.error.noDagId.message'));
+            break;
+          case 'job.dag.noname':
+            App.showAlertPopup(Em.I18n.t('jobs.hive.tez.dag.error.noDag.title'), Em.I18n.t('jobs.hive.tez.dag.error.noDag.message'));
+            break;
+          case 'job.dag.id.noDag':
+            App.showAlertPopup(Em.I18n.t('jobs.hive.tez.dag.error.noDagForId.title'), Em.I18n.t('jobs.hive.tez.dag.error.noDagForId.message'));
+            break;
+          case 'job.dag.id.loaderror':
+          case 'job.dag.name.loaderror':
+            break;
+          default:
+            break;
+          }
+          self.routeToJobs();
         });
       }
-    }else{
+    } else {
       clearTimeout(timeout);
-      timeout = setTimeout(function(){
+      timeout = setTimeout(function() {
         self.loadJobDetails();
       }, 300);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5bf01624/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 7ae897a..005fe68 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1931,12 +1931,12 @@ Em.I18n.translations = {
   'jobs.hive.tez.records.count':'{0} Records',
   'jobs.hive.tez.operatorPlan':'Operator Plan',
   'jobs.hive.tez.dag.summary.metric':'Summary Metric',
-  'jobs.hive.tez.dag.error.noDag.title':'No Tez DAG',
-  'jobs.hive.tez.dag.error.noDag.message':'Tez DAG not found Hive job {0}',
-  'jobs.hive.tez.dag.error.noDagId.title':'No Tez DAG ID',
-  'jobs.hive.tez.dag.error.noDagId.message':'Tez DAG has no ID associated with name {0}',
-  'jobs.hive.tez.dag.error.noDagForId.title':'No Tez DAG',
-  'jobs.hive.tez.dag.error.noDagForId.message':'No Tez DAG found for ID {0}',
+  'jobs.hive.tez.dag.error.noDag.title':'No Tez Information',
+  'jobs.hive.tez.dag.error.noDag.message':'This job does not identify any Tez information.',
+  'jobs.hive.tez.dag.error.noDagId.title':'No Tez Information',
+  'jobs.hive.tez.dag.error.noDagId.message':'No Tez information was found for this job. Either
it is waiting to be run, or has exited unexpectedly.',
+  'jobs.hive.tez.dag.error.noDagForId.title':'No Tez Information',
+  'jobs.hive.tez.dag.error.noDagForId.message':'No details were found for the Tez ID given
to this job.',
   'jobs.hive.tez.metric.input':'Input',
   'jobs.hive.tez.metric.output':'Output',
   'jobs.hive.tez.metric.recordsRead':'Records Read',

http://git-wip-us.apache.org/repos/asf/ambari/blob/5bf01624/ambari-web/app/utils/jobs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/jobs.js b/ambari-web/app/utils/jobs.js
index 3eed3f6..356aba6 100644
--- a/ambari-web/app/utils/jobs.js
+++ b/ambari-web/app/utils/jobs.js
@@ -25,9 +25,19 @@ module.exports = {
    *          job
    * @param {Function}
    *          successCallback
+   * @param {Funtion}
+   *          errorCallback(errorId) Called in error cases where there is no
+   *          data from server. 'errorId' can be one of
+   *          <ul>
+   *            <li>job.dag.noId</li>
+   *            <li>job.dag.noname</li>
+   *            <li>job.dag.id.noDag</li>
+   *            <li>job.dag.id.loaderror</li>
+   *            <li>job.dag.name.loaderror</li>
+   *          </ul>
    */
-  refreshJobDetails : function(job, successCallback) {
-    this.refreshHiveJobDetails(job, successCallback);
+  refreshJobDetails : function(job, successCallback, errorCallback) {
+    this.refreshHiveJobDetails(job, successCallback, errorCallback);
   },
 
   /**
@@ -37,8 +47,10 @@ module.exports = {
    *          hiveJob
    * @param {Function}
    *          successCallback
+   * @param {Function}
+   *          errorCallback @see #refreshJobDetails()
    */
-  refreshHiveJobDetails : function(hiveJob, successCallback) {
+  refreshHiveJobDetails : function(hiveJob, successCallback, errorCallback) {
     var self = this;
     // TODO - to be changed to history server when implemented in stack.
     var yarnService = App.YARNService.find().objectAt(0);
@@ -60,13 +72,15 @@ module.exports = {
               if (data && data.entities && data.entities.length > 0) {
                 var dagId = data.entities[0].entity;
                 App.TezDag.find(tezDagName).set('instanceId', dagId);
-                self.refreshTezDagDetails(tezDagName, successCallback);
+                self.refreshTezDagDetails(tezDagName, successCallback, errorCallback);
               }else{
-                App.showAlertPopup(Em.I18n.t('jobs.hive.tez.dag.error.noDagId.title'), Em.I18n.t('jobs.hive.tez.dag.error.noDagId.message').format(hiveJobId),
App.router.transitionTo('main.jobs.index'));
+                console.log('No Tez DAG was found for DAG name of ' + tezDagName);
+                errorCallback('job.dag.noId');
               }
             },
             dagNameToIdError : function(jqXHR, url, method, showStatus) {
               App.ajax.defaultErrorHandler(jqXHR, url, method, showStatus);
+              errorCallback('job.dag.name.loaderror');
             }
           }
           App.ajax.send({
@@ -81,7 +95,8 @@ module.exports = {
             error : 'dagNameToIdError'
           });
         } else {
-          App.showAlertPopup(Em.I18n.t('jobs.hive.tez.dag.error.noDag.title'), Em.I18n.t('jobs.hive.tez.dag.error.noDag.message').format(hiveJobId),
App.router.transitionTo('main.jobs.index'));
+          console.log('No Tez DAG name to ask ID for. Job ID: ' + hiveJobId);
+          errorCallback('job.dag.noname');
         }
       }
     });
@@ -95,8 +110,10 @@ module.exports = {
    *          tezDagId ID of the Tez DAG. Example: 'HIVE-Q2:1'
    * @param {Function}
    *          successCallback
+   * @param {Function}
+   *          errorCallback @see #refreshJobDetails()
    */
-  refreshTezDagDetails : function(tezDagId, successCallback) {
+  refreshTezDagDetails : function(tezDagId, successCallback, errorCallback) {
     var self = this;
     var yarnService = App.YARNService.find().objectAt(0);
     var ahsWebPort = yarnService.get('ahsWebPort');
@@ -120,6 +137,7 @@ module.exports = {
         },
         loadTezDagError : function(jqXHR, url, method, showStatus) {
           App.ajax.defaultErrorHandler(jqXHR, url, method, showStatus);
+          errorCallback('job.dag.id.loaderror');
         }
       }
       App.ajax.send({
@@ -133,8 +151,9 @@ module.exports = {
         success : 'loadTezDagSuccess',
         error : 'loadTezDagError'
       });
-    }else{
-      App.showAlertPopup(Em.I18n.t('jobs.hive.tez.dag.error.noDagForId.title'), Em.I18n.t('jobs.hive.tez.dag.error.noDagForId.message').format(tezDagId),
App.router.transitionTo('main.jobs.index'));
+    } else {
+      console.log('Unable to find DAG for ID: ' + tezDagId);
+      errorCallback('job.dag.id.noDag');
     }
   },
 


Mime
View raw message