use of org.apache.hadoop.hive.metastore.api.CommitTxnRequest in project hive by apache.
the class TestAcidTxnCleanerService method cleansCommittedAndEmptyAbortedOnly.
@Test
public void cleansCommittedAndEmptyAbortedOnly() throws Exception {
for (int i = 0; i < 5; ++i) {
// commit one
long txnid = openTxn();
txnHandler.commitTxn(new CommitTxnRequest(txnid));
// abort one empty
txnid = openTxn();
txnHandler.abortTxn(new AbortTxnRequest(txnid));
// abort one non-empty
openNonEmptyThenAbort();
}
Assert.assertEquals(15 + 1, getTxnCount());
Thread.sleep(txnHandler.getOpenTxnTimeOutMillis() * 2);
underTest.run();
// kept only the 5 non-empty aborted ones
Assert.assertEquals(5, getTxnCount());
Assert.assertTrue("The max txnId should be at least 15", getMaxTxnId() >= 15);
}
Aggregations