hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject hive git commit: HIVE-14311 : No need to schedule Heartbeat task if the query doesn't require locks (Wei Zheng, reviewed by Eugene Koifman)
Date Mon, 25 Jul 2016 16:31:49 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 f21a40e8b -> 943bb8536


HIVE-14311 : No need to schedule Heartbeat task if the query doesn't require locks (Wei Zheng,
reviewed by Eugene Koifman)


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

Branch: refs/heads/branch-1
Commit: 943bb85362470f295144c4046904e180b2900c32
Parents: f21a40e
Author: Wei Zheng <weiz@apache.org>
Authored: Mon Jul 25 09:32:05 2016 -0700
Committer: Wei Zheng <weiz@apache.org>
Committed: Mon Jul 25 09:33:24 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/943bb853/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java
index 85785fd..2526a63 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java
@@ -354,8 +354,10 @@ public class DbTxnManager extends HiveTxnManagerImpl {
    */
   @VisibleForTesting
   void acquireLocksWithHeartbeatDelay(QueryPlan plan, Context ctx, String username, long
delay) throws LockException {
-    acquireLocks(plan, ctx, username, true);
-    ctx.setHeartbeater(startHeartbeat(delay));
+    LockState ls = acquireLocks(plan, ctx, username, true);
+    if (ls != null) { // If there's no lock, we don't need to do heartbeat
+      ctx.setHeartbeater(startHeartbeat(delay));
+    }
   }
   
   @Override
@@ -437,6 +439,9 @@ public class DbTxnManager extends HiveTxnManagerImpl {
     }
     if(!isTxnOpen() && locks.isEmpty()) {
       // No locks, no txn, we outta here.
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("No need to send heartbeat as there is no transaction and no locks.");
+      }
       return;
     }
     for (HiveLock lock : locks) {


Mime
View raw message