Search in sources :

Example 1 with WriteInfo

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));
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) WriteInfo(com.palantir.atlasdb.sweep.queue.WriteInfo) Test(org.junit.Test)

Aggregations

WriteInfo (com.palantir.atlasdb.sweep.queue.WriteInfo)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Test (org.junit.Test)1