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 ff5086a..f5fce2c 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java @@ -26,6 +26,7 @@ import java.net.InetAddress; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -154,6 +155,7 @@ import org.slf4j.LoggerFactory; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.MoreObjects; import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; @@ -1670,6 +1672,10 @@ 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 = + MoreObjects.firstNonNull(ctx.getHiveLocks(), Collections.emptyList()); + LOG.info("Operation {} obtained {} locks", plan.getOperation(), + locks.size()); // This check is for controlling the correctness of the current state if (queryTxnMgr.recordSnapshot(plan) && !validTxnListsGenerated) { throw new IllegalStateException("calling recordValidTxn() more than once in the same " +