use of com.palantir.util.Pair in project atlasdb by palantir.
the class AbstractSweepTaskRunnerTest method runSweep.
@SuppressWarnings("unchecked")
private Pair<List<List<Cell>>, SweepResults> runSweep(CellsSweeper cellsSweeper, SweepTaskRunner spiedSweepRunner, int maxCellTsPairsToExamine, int candidateBatchSize, int deleteBatchSize) {
sweepTimestamp.set(Long.MAX_VALUE);
List<List<Cell>> sweptCells = Lists.newArrayList();
doAnswer((invocationOnMock) -> {
Object[] arguments = invocationOnMock.getArguments();
Collection<Cell> sentinelsToAdd = (Collection<Cell>) arguments[2];
sweptCells.add(new ArrayList(sentinelsToAdd));
return null;
}).when(cellsSweeper).sweepCells(eq(TABLE_NAME), any(), any());
SweepResults sweepResults = spiedSweepRunner.run(TABLE_NAME, ImmutableSweepBatchConfig.builder().maxCellTsPairsToExamine(maxCellTsPairsToExamine).candidateBatchSize(candidateBatchSize).deleteBatchSize(deleteBatchSize).build(), PtBytes.EMPTY_BYTE_ARRAY);
return new Pair(sweptCells, sweepResults);
}
Aggregations