tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbalamo...@apache.org
Subject tez git commit: TEZ-1784. Attempt details in tasks table (Sreenath Somarajapuram via Rajesh Balamohan)
Date Mon, 01 Dec 2014 05:37:38 GMT
Repository: tez
Updated Branches:
  refs/heads/TEZ-8 761f3c1b7 -> f6b5b8900


TEZ-1784. Attempt details in tasks table (Sreenath Somarajapuram via Rajesh Balamohan)


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

Branch: refs/heads/TEZ-8
Commit: f6b5b8900996bfaf5d69272691dbdf57a4b5f8bd
Parents: 761f3c1
Author: Rajesh Balamohan <rbalamohan@hortonworks.com>
Authored: Mon Dec 1 11:07:31 2014 +0530
Committer: Rajesh Balamohan <rbalamohan@hortonworks.com>
Committed: Mon Dec 1 11:07:31 2014 +0530

----------------------------------------------------------------------
 .../controllers/dag-task-attempts-controller.js | 185 +++++++++++++++++++
 .../app/scripts/controllers/dag_controller.js   |   1 +
 tez-ui/src/main/webapp/app/scripts/router.js    |  50 ++---
 3 files changed, 212 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/f6b5b890/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
new file mode 100644
index 0000000..d4564b8
--- /dev/null
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
@@ -0,0 +1,185 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.ColumnSelectorMixin,
{
+  // Required by the PaginatedContentMixin
+  needs: 'dag',
+  childEntityType: 'taskAttempt',
+
+  controllerName: 'DagTaskAttemptsController',
+
+  queryParams: {
+    status_filter: 'status',
+  },
+  status_filter: null,
+
+  loadData: function() {
+    var filters = {
+      primary: {
+        TEZ_DAG_ID: this.get('controllers.dag.id')
+      },
+      secondary: {
+        status: this.status_filter
+      }
+    }
+    this.setFiltersAndLoadEntities(filters);
+  },
+
+  actions : {
+    filterUpdated: function(filterID, value) {
+      // any validations required goes here.
+      if (!!value) {
+        this.set(filterID, value);
+      } else {
+        this.set(filterID, null);
+      }
+      this.loadData();
+    }
+  },
+
+  defaultColumnConfigs: function() {
+    return [
+      {
+        id: 'taskId',
+        headerCellName: 'Task ID',
+        tableCellViewClass: Em.Table.TableCell.extend({
+          template: Em.Handlebars.compile(
+            "{{#link-to 'task' view.cellContent class='ember-table-content'}}{{view.cellContent}}{{/link-to}}")
+        }),
+        contentPath: 'taskID',
+      },
+      {
+        id: 'attemptNo',
+        headerCellName: 'Attempt No',
+        tableCellViewClass: Em.Table.TableCell.extend({
+          template: Em.Handlebars.compile(
+            "{{#link-to 'taskAttempt' view.cellContent.attemptID class='ember-table-content'}}{{view.cellContent.attemptNo}}{{/link-to}}")
+        }),
+        getCellContent: function(row) {
+          var attemptID = row.get('id') || '',
+              attemptNo = attemptID.split(/[_]+/).pop();
+          return {
+            attemptNo: attemptNo,
+            attemptID: attemptID
+          };
+        }
+      },
+      {
+        id: 'startTime',
+        headerCellName: 'Start Time',
+        getCellContent: function(row) {
+          return App.Helpers.date.dateFormat(row.get('startTime'));
+        }
+      },
+      {
+        id: 'endTime',
+        headerCellName: 'End Time',
+        getCellContent: function(row) {
+          return App.Helpers.date.dateFormat(row.get('endTime'));
+        }
+      },
+      {
+        id: 'duration',
+        headerCellName: 'Duration',
+        getCellContent: function(row) {
+          var st = row.get('startTime');
+          var et = row.get('endTime');
+          if (st && et) {
+            return App.Helpers.date.durationSummary(st, et);
+          }
+        }
+      },
+      {
+        id: 'status',
+        headerCellName: 'Status',
+        filterID: 'status_filter',
+        filterType: 'dropdown',
+        dropdownValues: App.Helpers.misc.taskStatusUIOptions,
+        tableCellViewClass: Em.Table.TableCell.extend({
+          template: Em.Handlebars.compile(
+            '<span class="ember-table-content">&nbsp;\
+            <i {{bind-attr class=":task-status view.cellContent.statusIcon"}}></i>\
+            &nbsp;&nbsp;{{view.cellContent.status}}</span>')
+        }),
+        getCellContent: function(row) {
+          return {
+            status: row.get('status'),
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+          };
+        }
+      },
+      {
+        id: 'containerId',
+        headerCellName: 'Container',
+        contentPath: 'containerId'
+      },
+      {
+        id: 'nodeId',
+        headerCellName: 'Node',
+        contentPath: 'nodeId'
+      },
+      {
+        id: 'actions',
+        headerCellName: 'Actions',
+        tableCellViewClass: Em.Table.TableCell.extend({
+          template: Em.Handlebars.compile(
+            '<span class="ember-table-content">\
+            {{#link-to "taskAttempt.counters" view.cellContent}}counters{{/link-to}}&nbsp;\
+            </span>'
+            )
+        }),
+        contentPath: 'id'
+      },
+      {
+        id: 'logs',
+        headerCellName: 'Logs',
+        tableCellViewClass: Em.Table.TableCell.extend({
+          template: Em.Handlebars.compile(
+            '<span class="ember-table-content">\
+              {{#unless view.cellContent}}\
+                Not Available\
+              {{else}}\
+                <a href="//{{unbound view.cellContent}}">View</a>\
+                &nbsp;\
+                <a href="//{{unbound view.cellContent}}?start=0" download target="_blank"
type="application/octet-stream">Download</a>\
+              {{/unless}}\
+            </span>')
+        }),
+        getCellContent: function(row) {
+          var attempt = row.get('pivotAttempt');
+          var logFile = attempt && (attempt.get('inProgressLog') || attempt.get('completedLog'));
+          if(logFile) logFile += "/syslog_" + attempt.get('id');
+          return logFile;
+        }
+      }
+    ];
+
+  }.property(),
+
+  columnConfigs: function() {
+    return this.get('defaultColumnConfigs').concat(
+      App.Helpers.misc.normalizeCounterConfigs(
+        App.get('Configs.defaultCounters').concat(
+          App.get('Configs.tables.entity.taskAttempt') || [],
+          App.get('Configs.tables.sharedColumns') || []
+        )
+      )
+    );
+  }.property(),
+
+});

http://git-wip-us.apache.org/repos/asf/tez/blob/f6b5b890/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
index d35fb5a..6113cac 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
@@ -31,6 +31,7 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
 		Ember.Object.create({title: 'Details', linkTo: 'dag.index'}),
 		Ember.Object.create({title: 'Vertices', linkTo: 'dag.vertices'}),
 		Ember.Object.create({title: 'Tasks', linkTo: 'dag.tasks'}),
+		Ember.Object.create({title: 'Task Attempts', linkTo: 'dag.taskAttempts'}),
 		Ember.Object.create({title: 'Counters', linkTo: 'dag.counters'}),
 		Ember.Object.create({title: 'Swimlane', linkTo: 'dag.swimlane'})
 	],

http://git-wip-us.apache.org/repos/asf/tez/blob/f6b5b890/tez-ui/src/main/webapp/app/scripts/router.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/router.js b/tez-ui/src/main/webapp/app/scripts/router.js
index 3012cf2..a67b91f 100644
--- a/tez-ui/src/main/webapp/app/scripts/router.js
+++ b/tez-ui/src/main/webapp/app/scripts/router.js
@@ -17,13 +17,14 @@
  */
 
 App.Router.map(function() {
-	this.resource('dags', { path: '/' });
-	this.resource('dag', { path: '/dag/:dag_id'}, function() {
-		this.route('vertices');
-		this.route('tasks');
-		this.route('counters');
-		this.route('swimlane');
-	});
+  this.resource('dags', { path: '/' });
+  this.resource('dag', { path: '/dag/:dag_id'}, function() {
+    this.route('vertices');
+    this.route('tasks');
+    this.route('taskAttempts');
+    this.route('counters');
+    this.route('swimlane');
+  });
 
   this.resource('tez-app', {path: '/tez-app/:app_id'}, function(){
     this.route('dags');
@@ -41,16 +42,16 @@ App.Router.map(function() {
     this.route('details');
     this.route('swimlane');
   });
-	
-	this.resource('tasks', {path: '/tasks'});
-	this.resource('task', {path: '/task/:task_id'}, function(){
-		this.route('attempts');
-		this.route('counters');
-	});
-	this.resource('taskAttempt', {path: '/task_attempt/:task_attempt_id'}, function() {
-		this.route('counters');
-	});
-	//this.resource('error', {path:$ '/error'});
+
+  this.resource('tasks', {path: '/tasks'});
+  this.resource('task', {path: '/task/:task_id'}, function(){
+    this.route('attempts');
+    this.route('counters');
+  });
+  this.resource('taskAttempt', {path: '/task_attempt/:task_attempt_id'}, function() {
+    this.route('counters');
+  });
+  //this.resource('error', {path:$ '/error'});
 });
 
 /* --- Router helper functions --- */
@@ -124,13 +125,13 @@ App.DagRoute = Em.Route.extend({
 
 App.DagSwimlaneRoute = Em.Route.extend({
   renderTemplate: renderSwimlanes,
-	model: function(params) {
-		var model = this.modelFor('dag'),
-		    queryParams = {'primaryFilter': 'TEZ_DAG_ID:' + model.id};
-		this.store.unloadAll('task_attempt');
-		return this.store.findQuery('task_attempt', queryParams);
-	},
-	setupController: setupControllerFactory()
+  model: function(params) {
+    var model = this.modelFor('dag'),
+        queryParams = {'primaryFilter': 'TEZ_DAG_ID:' + model.id};
+    this.store.unloadAll('task_attempt');
+    return this.store.findQuery('task_attempt', queryParams);
+  },
+  setupController: setupControllerFactory()
 });
 
 /* --- Task related routes --- */
@@ -239,6 +240,7 @@ App.TezAppConfigsRoute = Em.Route.extend({
 
 App.DagTasksRoute =
     App.DagVerticesRoute =
+    App.DagTaskAttemptsRoute =
     App.VertexTasksRoute =
     App.VertexTaskAttemptsRoute =
     Em.Route.extend({


Mime
View raw message