HIVE-20797: Print Number of Locks Acquired (BELUGA BEHR via Peter Vary)
authorBELUGA BEHR <dam6923@gmail.com>
Thu, 7 Feb 2019 12:20:58 +0000 (13:20 +0100)
committerPeter Vary <pvary@cloudera.com>
Thu, 7 Feb 2019 12:20:58 +0000 (13:20 +0100)
ql/src/java/org/apache/hadoop/hive/ql/Driver.java

index d622ce0..95a4653 100644 (file)
@@ -1680,6 +1680,9 @@ public class Driver implements IDriver {
       /*It's imperative that {@code acquireLocks()} is called for all commands so that
       HiveTxnManager can transition its state machine correctly*/
       queryTxnMgr.acquireLocks(plan, ctx, userFromUGI, lDrvState);
+      final List<HiveLock> locks = ctx.getHiveLocks();
+      LOG.info("Operation {} obtained {} locks", plan.getOperation(),
+          ((locks == null) ? 0 : locks.size()));
       // This check is for controlling the correctness of the current state
       if (queryTxnMgr.recordSnapshot(plan) && !validTxnListsGenerated) {
         throw new IllegalStateException(