@Test
  public void testHeartbeatLockMaterializationRebuild() throws MetaException {
    txnHandler.lockMaterializationRebuild("default", "table1", 1L);

    boolean result = txnHandler.heartbeatLockMaterializationRebuild("default", "table1", 1L);

    assertTrue(result);
  }
counter = 0;
Thread1 counter=1, lock, wait 3s, check counter(should be 2), counter=3, unlock
Thread2 counter=2, lock (and block), inc counter, should be 4
ql/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandler.java