use of org.apache.hadoop.hive.common.ValidTxnList in project hive by apache.
the class TestValidCompactorTxnList method maxTxnLowNoExceptions.
@Test
public void maxTxnLowNoExceptions() {
ValidTxnList txns = new ValidCompactorTxnList(new long[0], 15);
ValidTxnList.RangeResponse rsp = txns.isTxnRangeValid(7, 9);
Assert.assertEquals(ValidTxnList.RangeResponse.ALL, rsp);
}
use of org.apache.hadoop.hive.common.ValidTxnList in project hive by apache.
the class TestValidCompactorTxnList method minTxnHighNoExceptions.
@Test
public void minTxnHighNoExceptions() {
ValidTxnList txns = new ValidCompactorTxnList(new long[0], 5);
ValidTxnList.RangeResponse rsp = txns.isTxnRangeValid(7, 9);
Assert.assertEquals(ValidTxnList.RangeResponse.NONE, rsp);
}
use of org.apache.hadoop.hive.common.ValidTxnList in project hive by apache.
the class TestValidCompactorTxnList method exceptionsAllBelow.
@Test
public void exceptionsAllBelow() {
ValidTxnList txns = new ValidCompactorTxnList(new long[] { 3, 6 }, 3);
ValidTxnList.RangeResponse rsp = txns.isTxnRangeValid(7, 9);
Assert.assertEquals(ValidTxnList.RangeResponse.NONE, rsp);
}
use of org.apache.hadoop.hive.common.ValidTxnList in project hive by apache.
the class TestHiveMetaStoreTxns method testTxns.
@Test
public void testTxns() throws Exception {
List<Long> tids = client.openTxns("me", 3).getTxn_ids();
Assert.assertEquals(1L, (long) tids.get(0));
Assert.assertEquals(2L, (long) tids.get(1));
Assert.assertEquals(3L, (long) tids.get(2));
client.rollbackTxn(1);
client.commitTxn(2);
ValidTxnList validTxns = client.getValidTxns();
Assert.assertFalse(validTxns.isTxnValid(1));
Assert.assertTrue(validTxns.isTxnValid(2));
Assert.assertFalse(validTxns.isTxnValid(3));
Assert.assertFalse(validTxns.isTxnValid(4));
}
use of org.apache.hadoop.hive.common.ValidTxnList in project hive by apache.
the class TestHiveMetaStoreTxns method testOpenTxnNotExcluded.
@Test
public void testOpenTxnNotExcluded() throws Exception {
List<Long> tids = client.openTxns("me", 3).getTxn_ids();
Assert.assertEquals(1L, (long) tids.get(0));
Assert.assertEquals(2L, (long) tids.get(1));
Assert.assertEquals(3L, (long) tids.get(2));
client.rollbackTxn(1);
client.commitTxn(2);
ValidTxnList validTxns = client.getValidTxns(3);
Assert.assertFalse(validTxns.isTxnValid(1));
Assert.assertTrue(validTxns.isTxnValid(2));
Assert.assertTrue(validTxns.isTxnValid(3));
Assert.assertFalse(validTxns.isTxnValid(4));
}
Aggregations