ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-17603. Error while generating Explain plan using Hive View 2.0.0. (dipayanb)
Date Fri, 08 Jul 2016 09:15:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e6b2f1ebe -> 4804954a3


AMBARI-17603. Error while generating Explain plan using Hive View 2.0.0. (dipayanb)


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

Branch: refs/heads/trunk
Commit: 4804954a3afe259d96d8daa38f69c4d7b4b72e31
Parents: e6b2f1e
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Fri Jul 8 14:44:29 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Fri Jul 8 14:44:58 2016 +0530

----------------------------------------------------------------------
 .../view/hive2/actor/OperationController.java   |  4 +++-
 .../controllers/index/history-query/explain.js  | 24 +++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4804954a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
index fa1ddd5..edef9ec 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
@@ -299,16 +299,18 @@ public class OperationController extends HiveActor {
   }
 
   private void freeConnector(FreeConnector message) {
-    LOG.info("About to free connector for job {} and user {}", message.getJobId(), message.getUsername());
     ActorRef sender = getSender();
     if (message.isForAsync()) {
+      LOG.info("About to free connector for job {} and user {}", message.getJobId(), message.getUsername());
       Optional<ActorRef> refOptional = removeFromAsyncBusyPool(message.getUsername(),
message.getJobId());
       if (refOptional.isPresent()) {
         addToAsyncAvailable(message.getUsername(), refOptional.get());
       }
       return;
     }
+
     // Was a sync job, remove from sync pool
+    LOG.info("About to free sync connector for user {}", message.getUsername());
     Optional<ActorRef> refOptional = removeFromSyncBusyPool(message.getUsername(),
sender);
     if (refOptional.isPresent()) {
       addToSyncAvailable(message.getUsername(), refOptional.get());

http://git-wip-us.apache.org/repos/asf/ambari/blob/4804954a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js
index bc74e0b..5365d03 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js
@@ -52,8 +52,30 @@ export default Ember.ObjectController.extend({
       url += '?first=true';
     }
 
+    var getExplainResult = function() {
+      var defer = Ember.RSVP.defer();
+      var attempt = 3;
+
+      var getResult = function() {
+        Ember.$.getJSON(url).then(function (json) {
+          defer.resolve(json);
+        }, function (err) {
+          if(err.status === 409 && attempt > 0) {
+            attempt--;
+            Ember.run.later(self, getResult, 3000); // Retry after 3 seconds
+          } else {
+            defer.reject(err);
+          }
+        });
+      };
+      getResult();
+      return defer.promise;
+    };
+
+
+
     this.get('content').reload().then(function () {
-      Ember.$.getJSON(url).then(function (data) {
+      getExplainResult().then(function (data) {
         var explainSet;
 
         //if rows from a previous page read exist, prepend them


Mime
View raw message