hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject hive git commit: HIVE-18878 : Lower MoveTask Lock Logging to Debug (Beluga Behr, Igor Kryvenko via Sahil Takiar)
Date Mon, 09 Apr 2018 02:14:02 GMT
Repository: hive
Updated Branches:
  refs/heads/master a2eb16d0f -> a263f0831


HIVE-18878 : Lower MoveTask Lock Logging to Debug (Beluga Behr, Igor Kryvenko via Sahil Takiar)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


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

Branch: refs/heads/master
Commit: a263f083123af2a49505b4680085408ef35bd621
Parents: a2eb16d
Author: BELUGA BEHR <dam6923@gmail.com>
Authored: Tue Mar 6 13:03:00 2018 -0800
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Sun Apr 8 19:13:13 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hive/ql/exec/MoveTask.java  | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/a263f083/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
index 7eba5e8..6fff7e7 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.hive.ql.exec;
 
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -210,34 +211,36 @@ public class MoveTask extends Task<MoveWork> implements Serializable
{
   private void releaseLocks(LoadTableDesc ltd) throws HiveException {
     // nothing needs to be done
     if (!conf.getBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY)) {
+      LOG.debug("No locks to release because Hive concurrency support is not enabled");
       return;
     }
 
     Context ctx = driverContext.getCtx();
-    if(ctx.getHiveTxnManager().supportsAcid()) {
+    if (ctx.getHiveTxnManager().supportsAcid()) {
       //Acid LM doesn't maintain getOutputLockObjects(); this 'if' just makes logic more
explicit
       return;
     }
+
     HiveLockManager lockMgr = ctx.getHiveTxnManager().getLockManager();
     WriteEntity output = ctx.getLoadTableOutputMap().get(ltd);
     List<HiveLockObj> lockObjects = ctx.getOutputLockObjects().get(output);
-    if (lockObjects == null) {
+    if (CollectionUtils.isEmpty(lockObjects)) {
+      LOG.debug("No locks found to release");
       return;
     }
 
+    LOG.info("Releasing {} locks", lockObjects.size());
     for (HiveLockObj lockObj : lockObjects) {
       List<HiveLock> locks = lockMgr.getLocks(lockObj.getObj(), false, true);
       for (HiveLock lock : locks) {
         if (lock.getHiveLockMode() == lockObj.getMode()) {
           if (ctx.getHiveLocks().remove(lock)) {
-            LOG.info("about to release lock for output: {} lock: {}", output,
-              lock.getHiveLockObject().getName());
             try {
               lockMgr.unlock(lock);
             } catch (LockException le) {
               // should be OK since the lock is ephemeral and will eventually be deleted
               // when the query finishes and zookeeper session is closed.
-              LOG.warn("Could not release lock {}", lock.getHiveLockObject().getName());
+              LOG.warn("Could not release lock {}", lock.getHiveLockObject().getName(), le);
             }
           }
         }


Mime
View raw message