use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.
the class AbstractSweepTaskRunnerTest method testSweepManyLatestDeletedThoroughIncludingUncommitted2.
@Test(timeout = 50000)
public void testSweepManyLatestDeletedThoroughIncludingUncommitted2() {
createTable(SweepStrategy.THOROUGH);
putIntoDefaultColumn("foo", "bar", 50);
putUncommitted("foo", "bad", 75);
putIntoDefaultColumn("foo", "baz", 100);
putIntoDefaultColumn("foo", "foo", 125);
putUncommitted("foo", "", 150);
SweepResults results = completeSweep(175).get();
assertEquals(4, results.getStaleValuesDeleted());
assertThat(results.getCellTsPairsExamined()).isGreaterThanOrEqualTo(5);
assertEquals("foo", getFromDefaultColumn("foo", 200));
assertEquals(ImmutableSet.of(125L), getAllTsFromDefaultColumn("foo"));
}
use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.
the class AbstractSweepTaskRunnerTest method testSweepManyValuesIncludingUncommittedConservative.
@Test(timeout = 50000)
public void testSweepManyValuesIncludingUncommittedConservative() {
createTable(SweepStrategy.CONSERVATIVE);
putIntoDefaultColumn("foo", "bar", 50);
putUncommitted("foo", "bad", 75);
putIntoDefaultColumn("foo", "baz", 100);
putIntoDefaultColumn("foo", "buzz", 125);
putUncommitted("foo", "foo", 150);
SweepResults results = completeSweep(175).get();
assertEquals(4, results.getStaleValuesDeleted());
assertThat(results.getCellTsPairsExamined()).isGreaterThanOrEqualTo(5);
assertEquals("buzz", getFromDefaultColumn("foo", 200));
assertEquals("", getFromDefaultColumn("foo", 124));
assertEquals(ImmutableSet.of(-1L, 125L), getAllTsFromDefaultColumn("foo"));
}
use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.
the class AbstractSweepTaskRunnerTest method testSweeperFailsHalfwayThroughOnDeleteTable.
@Test(timeout = 50000)
public void testSweeperFailsHalfwayThroughOnDeleteTable() {
createTable(SweepStrategy.CONSERVATIVE);
putIntoDefaultColumn("foo", "bar", 50);
putIntoDefaultColumn("foo2", "bang", 75);
putIntoDefaultColumn("foo3", "baz", 100);
putIntoDefaultColumn("foo4", "buzz", 125);
byte[] nextStartRow = partialSweep(150).getNextStartRow().get();
kvs.dropTable(TABLE_NAME);
SweepResults results = sweepRunner.run(TABLE_NAME, ImmutableSweepBatchConfig.builder().deleteBatchSize(DEFAULT_BATCH_SIZE).candidateBatchSize(DEFAULT_BATCH_SIZE).maxCellTsPairsToExamine(DEFAULT_BATCH_SIZE).build(), nextStartRow);
assertEquals(SweepResults.createEmptySweepResult(Optional.empty()), results);
}
use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.
the class AbstractSweepTaskRunnerTest method testSweepUncommittedThorough.
@Test(timeout = 50000)
public void testSweepUncommittedThorough() {
createTable(SweepStrategy.THOROUGH);
putIntoDefaultColumn("foo", "bar", 50);
putUncommitted("foo", "baz", 100);
SweepResults results = completeSweep(175).get();
assertEquals(1, results.getStaleValuesDeleted());
assertThat(results.getCellTsPairsExamined()).isGreaterThanOrEqualTo(2);
assertEquals("bar", getFromDefaultColumn("foo", 750));
assertEquals(ImmutableSet.of(50L), getAllTsFromDefaultColumn("foo"));
}
use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.
the class AbstractSweepTaskRunnerTest method testSweepStrategyNothing.
@Test(timeout = 50000)
public void testSweepStrategyNothing() {
createTable(SweepStrategy.NOTHING);
putIntoDefaultColumn("foo", "bar", 50);
putUncommitted("foo", "bad", 75);
putIntoDefaultColumn("foo", "baz", 100);
putIntoDefaultColumn("foo", "buzz", 125);
putUncommitted("foo", "foo", 150);
SweepResults results = sweepRunner.run(TABLE_NAME, ImmutableSweepBatchConfig.builder().deleteBatchSize(DEFAULT_BATCH_SIZE).candidateBatchSize(DEFAULT_BATCH_SIZE).maxCellTsPairsToExamine(DEFAULT_BATCH_SIZE).build(), PtBytes.EMPTY_BYTE_ARRAY);
assertEquals(SweepResults.createEmptySweepResult(Optional.empty()), results);
assertEquals(ImmutableSet.of(50L, 75L, 100L, 125L, 150L), getAllTsFromDefaultColumn("foo"));
}
Aggregations