commit 0e41d0565f3ae369156ce69629985f9793725a01 Author: Vihang Karajgaonkar Date: Fri Mar 3 18:18:24 2017 -0800 HIVE-16109 : TestDbTxnManager generates a huge hive.log diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java index 01acba5eeed55e1e9ef7e2f9a6d385ca1c783600..d378d06f937937e10a101196c02a44a421809f71 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java @@ -2597,10 +2597,10 @@ private LockResponse checkLock(Connection dbConn, long extLockId) // Turn the tree set into an array so we can move back and forth easily // in it. LockInfo[] locks = lockSet.toArray(new LockInfo[lockSet.size()]); - if(LOG.isDebugEnabled()) { - LOG.debug("Locks to check(full): "); + if(LOG.isTraceEnabled()) { + LOG.trace("Locks to check(full): "); for(LockInfo info : locks) { - LOG.debug(" " + info); + LOG.trace(" " + info); } } diff --git a/ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager.java b/ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager.java index 6c53538f3816b5c6bf96135cca46e4e8a38b4ffa..9bfc7d1f11504ebd8eefa16d443c8c7ccc638d35 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager.java @@ -57,7 +57,7 @@ * See additional tests in {@link org.apache.hadoop.hive.ql.lockmgr.TestDbTxnManager2} */ public class TestDbTxnManager { - + private static final int TEST_TIMED_OUT_TXN_ABORT_BATCH_SIZE = 1000; private final HiveConf conf = new HiveConf(); private HiveTxnManager txnMgr; private AcidHouseKeeperService houseKeeperService = null; @@ -257,10 +257,10 @@ public void testLockTimeout() throws Exception { testLockExpiration(txnMgr, 5, true); //create a lot of locks - for(int i = 0; i < TxnStore.TIMED_OUT_TXN_ABORT_BATCH_SIZE + 17; i++) { + for(int i = 0; i < TEST_TIMED_OUT_TXN_ABORT_BATCH_SIZE + 17; i++) { ((DbTxnManager)txnMgr).acquireLocks(qp, ctx, "PeterI" + i, true); // No heartbeat } - testLockExpiration(txnMgr, TxnStore.TIMED_OUT_TXN_ABORT_BATCH_SIZE + 17, true); + testLockExpiration(txnMgr, TEST_TIMED_OUT_TXN_ABORT_BATCH_SIZE + 17, true); // Create a lock, but send the heartbeat with a long delay. The lock will get expired. ((DbTxnManager)txnMgr).acquireLocksWithHeartbeatDelay(qp, ctx, "bob",