use of org.apache.hadoop.hive.common.ValidCompactorTxnList in project hive by apache.
the class TestValidCompactorTxnList method writeToString.
@Test
public void writeToString() {
ValidTxnList txns = new ValidCompactorTxnList(new long[] { 9, 7, 10, Long.MAX_VALUE }, 8);
Assert.assertEquals("8:" + Long.MAX_VALUE + ":7", txns.writeToString());
txns = new ValidCompactorTxnList();
Assert.assertEquals(Long.toString(Long.MAX_VALUE) + ":" + Long.MAX_VALUE + ":", txns.writeToString());
txns = new ValidCompactorTxnList(new long[0], 23);
Assert.assertEquals("23:" + Long.MAX_VALUE + ":", txns.writeToString());
}
use of org.apache.hadoop.hive.common.ValidCompactorTxnList in project hive by apache.
the class TestValidCompactorTxnList method exceptionsInMidst.
@Test
public void exceptionsInMidst() {
ValidTxnList txns = new ValidCompactorTxnList(new long[] { 8 }, 7);
ValidTxnList.RangeResponse rsp = txns.isTxnRangeValid(7, 9);
Assert.assertEquals(ValidTxnList.RangeResponse.NONE, rsp);
}
use of org.apache.hadoop.hive.common.ValidCompactorTxnList in project hive by apache.
the class TestValidCompactorTxnList method exceptionsAbveHighWaterMark.
@Test
public void exceptionsAbveHighWaterMark() {
ValidTxnList txns = new ValidCompactorTxnList(new long[] { 8, 11, 17, 29 }, 15);
Assert.assertArrayEquals("", new long[] { 8, 11 }, txns.getInvalidTransactions());
ValidTxnList.RangeResponse rsp = txns.isTxnRangeValid(7, 9);
Assert.assertEquals(ValidTxnList.RangeResponse.ALL, rsp);
rsp = txns.isTxnRangeValid(12, 16);
Assert.assertEquals(ValidTxnList.RangeResponse.NONE, rsp);
}
Aggregations