123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- /**
- * 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.
- */
- var App = require('app');
- var dateUtils = require('utils/date');
- var numberUtils = require('utils/number_utils');
- App.TezDag = DS.Model.extend({
- id : DS.attr('string'),
- /**
- * When DAG is actually running on server, a unique ID is assigned.
- */
- instanceId : DS.attr('string'),
- name : DS.attr('string'),
- yarnApplicationId: DS.attr('string'),
- stage : DS.attr('string'),
- vertices : DS.hasMany('App.TezDagVertex'),
- edges : DS.hasMany('App.TezDagEdge')
- });
- App.TezDagEdge = DS.Model.extend({
- id : DS.attr('string'),
- instanceId : DS.attr('string'),
- fromVertex : DS.belongsTo('App.TezDagVertex'),
- toVertex : DS.belongsTo('App.TezDagVertex'),
- /**
- * Type of this edge connecting vertices. Should be one of constants defined
- * in 'App.TezDagEdgeType'.
- */
- edgeType : DS.attr('string')
- });
- App.TezDagVertex = DS.Model.extend({
- id : DS.attr('string'),
- /**
- * When DAG vertex is actually running on server, a unique ID is assigned.
- */
- instanceId : DS.attr('string'),
- name : DS.attr('string'),
- /**
- * State of this vertex. Should be one of constants defined in
- * App.TezDagVertexState.
- */
- state : DS.attr('string'),
- /**
- * Vertex type has to be one of the types defined in 'App.TezDagVertexType'
- * @return {string}
- */
- type : DS.attr('string'),
- /**
- * A vertex can have multiple incoming edges.
- */
- incomingEdges : DS.hasMany('App.TezDagEdge'),
- /**
- * This vertex can have multiple outgoing edges.
- */
- outgoingEdges : DS.hasMany('App.TezDagEdge'),
- startTime : DS.attr('number'),
- endTime : DS.attr('number'),
- /**
- * Provides the duration of this job. If the job has not started, duration
- * will be given as 0. If the job has not ended, duration will be till now.
- *
- * @return {Number} Duration in milliseconds.
- */
- duration : function() {
- return dateUtils.duration(this.get('startTime'), this.get('endTime'))
- }.property('startTime', 'endTime'),
- /**
- * Each Tez vertex can perform arbitrary application specific computations
- * inside. The application can provide a list of operations it has provided in
- * this vertex.
- *
- * Array of strings. [{string}]
- */
- operations : DS.attr('array'),
- /**
- * Provides additional information about the 'operations' performed in this
- * vertex. This is shown directly to the user.
- */
- operationPlan : DS.attr('string'),
- /**
- * Number of actual Map/Reduce tasks in this vertex
- */
- tasksCount : DS.attr('number'),
- tasksNumber: function () {
- return this.get('tasksCount') ? this.get('tasksCount') : 0;
- }.property('tasksCount'),
- /**
- * Local filesystem usage metrics for this vertex
- */
- fileReadBytes : DS.attr('number'),
- fileWriteBytes : DS.attr('number'),
- fileReadOps : DS.attr('number'),
- fileWriteOps : DS.attr('number'),
- /**
- * Spilled records
- */
- spilledRecords : DS.attr('number'),
- /**
- * HDFS usage metrics for this vertex
- */
- hdfsReadBytes : DS.attr('number'),
- hdfsWriteBytes : DS.attr('number'),
- hdfsReadOps : DS.attr('number'),
- hdfsWriteOps : DS.attr('number'),
- /**
- * Record metrics for this vertex
- */
- recordReadCount : DS.attr('number'),
- recordWriteCount : DS.attr('number'),
- totalReadBytes : function() {
- return this.get('fileReadBytes') + this.get('hdfsReadBytes');
- }.property('fileReadBytes', 'hdfsReadBytes'),
- totalWriteBytes : function() {
- return this.get('fileWriteBytes') + this.get('hdfsWriteBytes');
- }.property('fileWriteBytes', 'hdfsWriteBytes'),
- totalReadBytesDisplay : function() {
- return numberUtils.bytesToSize(this.get('totalReadBytes'));
- }.property('totalReadBytes'),
- totalWriteBytesDisplay : function() {
- return numberUtils.bytesToSize(this.get('totalWriteBytes'));
- }.property('totalWriteBytes'),
- durationDisplay : function() {
- return dateUtils.timingFormat(this.get('duration'), true);
- }.property('duration')
- });
- App.TezDagVertexState = {
- NEW : "NEW",
- INITIALIZING : "INITIALIZING",
- INITED : "INITED",
- RUNNING : "RUNNING",
- SUCCEEDED : "SUCCEEDED",
- FAILED : "FAILED",
- KILLED : "KILLED",
- ERROR : "ERROR",
- TERMINATING : "TERMINATING",
- JOBFAILED: "JOB FAILED"
- };
- App.TezDagVertexType = {
- MAP: 'MAP',
- REDUCE: 'REDUCE',
- UNION: 'UNION'
- };
- App.TezDagEdgeType = {
- SCATTER_GATHER : "SCATTER_GATHER",
- BROADCAST : "BROADCAST",
- CONTAINS: "CONTAINS"
- };
- App.TezDag.FIXTURES = [];
- App.TezDagEdge.FIXTURES = [];
- App.TezDagVertex.FIXTURES = [];
|