diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java index 01ecf0a..87e8a21 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java @@ -40,6 +40,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.stream.Collectors; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; @@ -1679,6 +1680,9 @@ private void acquireLocks() throws CommandProcessorResponse { /*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 locks = ctx.getHiveLocks(); + LOG.info("Operation {} obtained {} locks", plan.getOperation(), + CollectionUtils.size(locks)); // This check is for controlling the correctness of the current state if (queryTxnMgr.recordSnapshot(plan) && !validTxnListsGenerated) { throw new IllegalStateException(