use of com.palantir.atlasdb.sweep.queue.WriteInfo in project atlasdb by palantir.
the class SnapshotTransactionTest method committedWritesAreAddedToSweepQueue.
@Test
public void committedWritesAreAddedToSweepQueue() {
List<WriteInfo> table1Writes = ImmutableList.of(WriteInfo.of(Cell.create("a".getBytes(), "b".getBytes()), false, 2L), WriteInfo.of(Cell.create("a".getBytes(), "c".getBytes()), false, 2L), WriteInfo.of(Cell.create("a".getBytes(), "d".getBytes()), true, 2L), WriteInfo.of(Cell.create("b".getBytes(), "d".getBytes()), false, 2L));
List<WriteInfo> table2Writes = ImmutableList.of(WriteInfo.of(Cell.create("w".getBytes(), "x".getBytes()), false, 2L), WriteInfo.of(Cell.create("y".getBytes(), "z".getBytes()), false, 2L), WriteInfo.of(Cell.create("z".getBytes(), "z".getBytes()), true, 2L));
AtomicLong startTs = new AtomicLong(0);
txManager.runTaskWithRetry(txn -> {
table1Writes.forEach(write -> {
put(txn, TABLE1, write);
});
table2Writes.forEach(write -> {
put(txn, TABLE2, write);
});
return null;
});
verify(sweepQueue).enqueue(eq(TABLE1), eq(table1Writes));
verify(sweepQueue).enqueue(eq(TABLE2), eq(table2Writes));
}
Aggregations