Sfoglia il codice sorgente

AMBARI-5003. Jobs page w/o DAG loop in UI. (srimanth)

Srimanth Gunturi 11 anni fa
parent
commit
592e16f370

+ 8 - 2
ambari-server/src/main/resources/stacks/HDP/2.1.1/services/HIVE/configuration/hive-site.xml

@@ -297,13 +297,19 @@ limitations under the License.
   <property>
     <name>hive.exec.post.hooks</name>
     <value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
-    <description>Post Execute Hook for Tests</description>
+    <description>Comma-separated list of post-execution hooks to be invoked for each statement.</description>
   </property>
 
   <property>
     <name>hive.exec.pre.hooks</name>
     <value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
-    <description>Pre Execute Hook for Tests</description>
+    <description>Comma-separated list of pre-execution hooks to be invoked for each statement.</description>
+  </property>
+
+  <property>
+    <name>hive.exec.failure.hooks</name>
+    <value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
+    <description>Comma-separated list of on-failure hooks to be invoked for each statement.</description>
   </property>
 
   <property>

File diff suppressed because it is too large
+ 1 - 1
ambari-web/app/assets/data/jobs/hive-queries.json


+ 2 - 0
ambari-web/app/mappers/jobs/hive_jobs_mapper.js

@@ -43,6 +43,8 @@ App.hiveJobsMapper = App.QuickDataMapper.create({
         hiveJob.has_tez_dag = false;
         hiveJob.query_text = '';
         if (entity.otherinfo && entity.otherinfo.query) {
+          // Explicit false match needed for when failure hook not set
+          hiveJob.failed = entity.otherinfo.status===false;
           hiveJob.has_tez_dag = entity.otherinfo.query.match("\"Tez\".*\"DagName:\"");
           var queryJson = $.parseJSON(entity.otherinfo.query);
           if (queryJson && queryJson.queryText) {

+ 1 - 0
ambari-web/app/messages.js

@@ -1915,6 +1915,7 @@ Em.I18n.translations = {
   'jobs.table.custom.date.am':'AM',
   'jobs.table.custom.date.pm':'PM',
   'jobs.table.custom.date.header':'Select Custom Dates',
+  'jobs.table.job.fail':'Job failed to run',
   'jobs.customDateFilter.error.required':'This field is required',
   'jobs.customDateFilter.error.date.order':'End Date must be after Start Date',
   'jobs.customDateFilter.startTime':'Start Time',

+ 2 - 1
ambari-web/app/models/jobs/hive_job.js

@@ -22,7 +22,8 @@ App.HiveJob = App.AbstractJob.extend({
   queryText : DS.attr('string'),
   stages : DS.attr('array'),
   hasTezDag: DS.attr('boolean'),
-  tezDag : DS.belongsTo('App.TezDag')
+  tezDag : DS.belongsTo('App.TezDag'),
+  failed: DS.attr('boolean')
 });
 
 App.HiveJob.FIXTURES = [];

+ 4 - 0
ambari-web/app/styles/application.less

@@ -258,6 +258,10 @@ h1 {
   color: #FF4B4B;
 }
 
+.icon-remove-sign {
+  color: #FF4B4B;
+}
+
 .icon-question-sign {
   color: #999;
 }

+ 11 - 7
ambari-web/app/styles/apps.less

@@ -410,20 +410,24 @@
     td:first-child,
     th:first-child {
       border-left-width: 1px;
-      width: 36%;
+      width: 14px;
     }
     td:first-child + td,
-    th:first-child + th{
-      width: 20%;
+    th:first-child + th {
+      width: 36%;
     }
     td:first-child + td + td,
-    th:first-child + th + th,
-    td:first-child + td + td + td,
-    th:first-child + th + th + th{
-      width: 16%;
+    th:first-child + th + th{
+      width: 20%;
     }
+    td:first-child + td + td + td,
+    th:first-child + th + th + th,
     td:first-child + td + td + td + td,
     th:first-child + th + th + th + th{
+      width: 16%;
+    }
+    td:first-child + td + td + td + td + td,
+    th:first-child + th + th + th + th + th{
       width: 12%;
     }
   }

+ 6 - 0
ambari-web/app/templates/main/jobs.hbs

@@ -35,6 +35,7 @@
           {{/view}}
 
           <tr id="filter-row" class="first">
+              <th></th>
               <th>{{view view.jobsIdFilterView}}</th>
               <th>{{view view.userFilterView}}</th>
               <th class="start-time">{{view view.startTimeFilterView}}</th>
@@ -50,6 +51,11 @@
           {{else}}
             {{#each job in view.pageContent}}
               <tr>
+                <td>
+                  {{#if job.failed}}
+                    <i class="icon-remove-sign job-link" {{bindAttr title="view.jobFailMessage"}}></i>
+                  {{/if}}
+                </td>
                 <td>
                   <div class="id">
                     {{#if job.hasTezDag}}

+ 10 - 6
ambari-web/app/views/main/jobs_view.js

@@ -59,31 +59,31 @@ App.MainJobsView = App.TableView.extend({
 
   sortView: sort.wrapperView,
   idSort: sort.fieldView.extend({
-    column: 0,
+    column: 1,
     name: 'id',
     displayName: Em.I18n.t('jobs.column.id'),
     type: 'string'
   }),
   userSort: sort.fieldView.extend({
-    column: 1,
+    column: 2,
     name: 'user',
     displayName: Em.I18n.t('jobs.column.user'),
     type: 'string'
   }),
   startTimeSort: sort.fieldView.extend({
-    column: 2,
+    column: 3,
     name: 'startTime',
     displayName: Em.I18n.t('jobs.column.start.time'),
     type: 'number'
   }),
   endTimeSort: sort.fieldView.extend({
-    column: 3,
+    column: 4,
     name: 'endTime',
     displayName: Em.I18n.t('jobs.column.end.time'),
     type: 'number'
   }),
   durationSort: sort.fieldView.extend({
-    column: 4,
+    column: 5,
     name: 'duration',
     displayName: Em.I18n.t('jobs.column.duration'),
     type: 'number'
@@ -168,5 +168,9 @@ App.MainJobsView = App.TableView.extend({
         childView.clearFilter();
       }
     });
-  }
+  },
+
+  jobFailMessage: function() {
+    return Em.I18n.t('jobs.table.job.fail');
+  }.property()
 })

Some files were not shown because too many files changed in this diff