ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [1/2] ambari git commit: AMBARI-10214. Pig View: Enable Execute on Tez (alexantonenko)
Date Thu, 26 Mar 2015 19:22:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk cc69a00c3 -> 6bceddf17


AMBARI-10214. Pig View: Enable Execute on Tez (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 6bceddf1731fa9a32981bad3c599c1f20b14137d
Parents: 08833fe
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Thu Mar 26 18:47:49 2015 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu Mar 26 21:22:46 2015 +0200

----------------------------------------------------------------------
 .../ui/pig-web/app/controllers/script.js        | 17 ++++++++++---
 .../ui/pig-web/app/controllers/scriptEdit.js    |  9 +++++++
 .../resources/ui/pig-web/app/models/pig_job.js  |  8 ++++++-
 .../resources/ui/pig-web/app/styles/style.less  | 25 +++++++++++---------
 .../ui/pig-web/app/templates/script/edit.hbs    |  5 ++++
 .../resources/ui/pig-web/app/translations.js    |  1 +
 6 files changed, 50 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6bceddf1/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/script.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/script.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/script.js
index d2a4891..586de2f 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/script.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/script.js
@@ -19,6 +19,10 @@
 var App = require('app');
 
 App.ScriptController = Em.ObjectController.extend({
+  init: function(){
+    this.pollster.set('target',this);
+    this._super();
+  },
   actions :{
     deactivateJob:function (jobId) {
       var rejected = this.get('activeJobs').rejectBy('id',jobId);
@@ -79,7 +83,7 @@ App.ScriptController = Em.ObjectController.extend({
 
   tabs:Em.computed.union('staticTabs','jobTabs'),
 
-  pollster:Em.Object.create({
+  pollster:Em.Object.createWithMixins(Ember.ActionHandler,{
     jobs:[],
     timer:null,
     start: function(jobs){
@@ -93,7 +97,14 @@ App.ScriptController = Em.ObjectController.extend({
     onPoll: function() {
       this.get('jobs').forEach(function (job) {
         if (job.get('jobInProgress')) {
-          job.reload();
+          job.reload().catch(function (error) {
+            this.send('showAlert',{
+              message:Em.I18n.t('job.alert.delete_filed'),
+              status:'error',
+              trace:(error.responseJSON)?error.responseJSON.trace:null
+            });
+            this.jobs.removeObject(job);
+          }.bind(this));
         } else {
           this.jobs.removeObject(job);
         }
@@ -102,7 +113,7 @@ App.ScriptController = Em.ObjectController.extend({
       if (this.get('jobs.length') > 0) {
         this.set('timer', Ember.run.later(this, function() {
           this.onPoll();
-        }, 3000));
+        }, 10000));
       }
     }
   }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bceddf1/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptEdit.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptEdit.js
b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptEdit.js
index e59f093..60a04ce 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptEdit.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptEdit.js
@@ -107,6 +107,9 @@ App.ScriptEditController = Em.ObjectController.extend({
         .then(this.executeSuccess.bind(this), this.executeError.bind(this))
         .finally(Em.run.bind(this,this.set,'isExec',false));
     },
+    toggleTez:function () {
+      this.toggleProperty('executeOnTez');
+    },
     fullscreen:function () {
       this.toggleProperty('fullscreen');
     }
@@ -124,6 +127,8 @@ App.ScriptEditController = Em.ObjectController.extend({
     this.send('showAlert', {message:Em.I18n.t('job.alert.start_filed'),status:'error',trace:trace});
   },
 
+  executeOnTez:false,
+
   prepareJob:function (type, data) {
     var job, promise,
         exc = 'execute' == type,
@@ -142,6 +147,10 @@ App.ScriptEditController = Em.ObjectController.extend({
       fileContent = fileContent.replace(rgParam,param.value);
     });
 
+    if (this.get('executeOnTez') && args.indexOf('-x\ttez') < 0) {
+      args = args + (args ? "\t" : "") + '-x\ttez';
+    }
+
     job = this.store.createRecord('job', {
 
       /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bceddf1/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
index 441c5ad..737c2e5 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
@@ -90,5 +90,11 @@ App.Job = DS.Model.extend({
     }
     var args = this.get('templetonArguments');
     return (args && args.length > 0)?args.w():[];
-  }.property('templetonArguments')
+  }.property('templetonArguments'),
+
+  notFound: function() {
+    if (this.get('isLoaded')) {
+      this.set('status','FAILED');
+    }
+  }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bceddf1/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less b/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
index c47eb83..6a0e62c 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
@@ -24,7 +24,7 @@
 @import './../../bower_components/bootstrap/less/bootstrap.less';
 
 .wrap {
-  padding: 0px;
+  padding: 0;
 }
 
 .moz-padding (@selector, @pre: ~'', @padding) {
@@ -125,7 +125,7 @@
       left: 102%;
       position: relative;
       height: 100%;
-      box-shadow: -2px 0px 1px rgba(0, 0, 0, 0.20);
+      box-shadow: -2px 0 1px rgba(0, 0, 0, 0.20);
       .base-transition( left 300ms linear;);
 
       .nav-script {
@@ -183,9 +183,8 @@
     }
   }
   .pig-nav-item {
-    word-break: break-word;
+    word-wrap: break-word;
     .rm {
-      top:2px;
       position: absolute;
       right: 5px;
       top: 5px;
@@ -208,10 +207,9 @@
     position: absolute;
     color: @brand-primary;
     top: 1px;
-    padding: 0px;
     background: transparent;
     right: 3px;
-    padding: 0px 4px;
+    padding: 0 4px;
   }
 }
 
@@ -306,6 +304,11 @@
 //edit script
 .edit-script {
   .panel-editscript {
+
+    .tez-exec {
+      padding: 6px 12px;
+    }
+
     margin-bottom: 5px;
     textarea {
       width: 100%;
@@ -342,7 +345,7 @@
       position: absolute;
       cursor: s-resize;
       color: #999999;
-      zndex: 2;
+      z-index: 2;
     }
     .table-results {
       .argument {
@@ -462,7 +465,7 @@
       .panel-heading {
         position: fixed;
         top: 0;
-        right: 0px;
+        right: 0;
         left: 0;
         z-index: 77;
         border-top: 1px solid #ddd;
@@ -472,7 +475,7 @@
       .panel-body {
         position: fixed;
         top: 55px;
-        right: 0px;
+        right: 0;
         left: 0;
         z-index: 76;
         border-right: 1px solid #ddd;
@@ -560,7 +563,7 @@
 }
 
 .main-content {
-    padding-left: 0px;
+    padding-left: 0;
 }
 
 .job-container {
@@ -621,7 +624,7 @@
       &.fullscreen {
         position: fixed;
         top: 0;
-        right: 0px;
+        right: 0;
         left: 0;
         z-index: 77;
         border-top: 1px solid #ddd;

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bceddf1/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/script/edit.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/script/edit.hbs
b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/script/edit.hbs
index 854c751..69d3341 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/script/edit.hbs
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/script/edit.hbs
@@ -35,6 +35,11 @@
             <li><a href="#" {{action "execute" content 'syntax_check' }} >{{t
'editor.syntax_check'}}</a></li>
           </ul>
         </div>
+        <div class="btn-group btn-group-xs pull-right tez-exec">
+          <label class="btn btn-default" {{action 'toggleTez'}}>
+            <i {{bind-attr class=":fa executeOnTez:fa-check-square-o:fa-square-o"}}></i>
{{t 'editor.execute_on_tez'}}
+          </label>
+        </div>
         {{else}}
         <div class="spinner-sm pull-right"></div>
       {{/unless}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bceddf1/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
index 45abf48..5bb8cf7 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
@@ -101,6 +101,7 @@ Ember.I18n.translations = {
     'execute':'Execute',
     'explain':'Explain',
     'syntax_check':'Syntax check',
+    'execute_on_tez':'Execute on Tez',
     'toggle_fullscreen':'Toggle fullscreen (F11)'
   },
   'job':{


Mime
View raw message