use of org.voltcore.messaging.VoltMessage in project voltdb by VoltDB.
the class TestRepairLog method testOffer.
@Test
public void testOffer() {
final AtomicLong lastCommitted = new AtomicLong(Long.MIN_VALUE);
final TransactionCommitInterest interest = lastCommitted::set;
// offer some various messages to log and check
// that it keeps the expected ones.
RepairLog rl = new RepairLog();
rl.registerTransactionCommitInterest(interest);
VoltMessage m1 = nonTruncInitMsg();
VoltMessage m2 = nonTruncInitMsg();
rl.deliver(m1);
rl.deliver(m2);
List<Iv2RepairLogResponseMessage> contents = rl.contents(1l, false);
assertEquals(3, contents.size());
assertEquals(m1, contents.get(1).getPayload());
assertEquals(m2, contents.get(2).getPayload());
assertEquals(Long.MIN_VALUE, lastCommitted.get());
}
Aggregations