use of com.palantir.atlasdb.cassandra.backup.transaction.Transactions1TableInteraction in project atlasdb by palantir.
the class CassandraRepairEteTest method testRepairOnlyTxn1.
@Test
public void testRepairOnlyTxn1() {
List<String> tablesRepaired = new ArrayList<>();
BiConsumer<String, RangesForRepair> repairer = (table, _unused) -> tablesRepaired.add(table);
List<TransactionsTableInteraction> interactions = ImmutableList.of(new Transactions1TableInteraction(range(1L, 10_000_000L), POLICY));
cassandraRepairHelper.repairTransactionsTables(ATLAS_SERVICE, interactions, repairer);
assertThat(tablesRepaired).containsExactly(TransactionConstants.TRANSACTION_TABLE.getTableName());
}
use of com.palantir.atlasdb.cassandra.backup.transaction.Transactions1TableInteraction in project atlasdb by palantir.
the class CassandraRepairEteTest method testRepairsEachTableOnceOnly.
@Test
public void testRepairsEachTableOnceOnly() {
List<String> tablesRepaired = new ArrayList<>();
AtomicInteger numRepairs = new AtomicInteger(0);
BiConsumer<String, RangesForRepair> repairer = (table, _unused) -> {
numRepairs.incrementAndGet();
tablesRepaired.add(table);
};
List<TransactionsTableInteraction> interactions = ImmutableList.of(new Transactions1TableInteraction(range(1L, 5L), POLICY), new Transactions2TableInteraction(range(6L, 10L), POLICY), new Transactions1TableInteraction(range(11L, 15L), POLICY), new Transactions2TableInteraction(range(16L, 20L), POLICY));
cassandraRepairHelper.repairTransactionsTables(ATLAS_SERVICE, interactions, repairer);
assertThat(tablesRepaired).containsExactlyInAnyOrder(TransactionConstants.TRANSACTION_TABLE.getTableName(), TransactionConstants.TRANSACTIONS2_TABLE.getTableName());
assertThat(numRepairs).hasValue(2);
}
Aggregations