Search in sources :

Example 26 with SweepResults

use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.

the class CassandraKeyValueServiceSweepTaskRunnerIntegrationTest method should_return_values_for_multiple_columns_when_sweeping.

@Test
public void should_return_values_for_multiple_columns_when_sweeping() {
    createTable(TableMetadataPersistence.SweepStrategy.CONSERVATIVE);
    for (int ts = 10; ts <= 150; ts += 10) {
        put("row", "col1", "value", ts);
        put("row", "col2", "value", ts + 5);
    }
    SweepResults results = completeSweep(350).get();
    Assert.assertEquals(28, results.getStaleValuesDeleted());
}
Also used : SweepResults(com.palantir.atlasdb.keyvalue.api.SweepResults) AbstractSweepTaskRunnerTest(com.palantir.atlasdb.sweep.AbstractSweepTaskRunnerTest) Test(org.junit.Test)

Example 27 with SweepResults

use of com.palantir.atlasdb.keyvalue.api.SweepResults in project atlasdb by palantir.

the class CassandraKeyValueServiceSweepTaskRunnerIntegrationTest method should_not_oom_when_there_are_many_large_values_to_sweep.

@Test
public void should_not_oom_when_there_are_many_large_values_to_sweep() {
    Assume.assumeTrue("should_not_oom test will always fail if column batch size is not set!", useColumnBatchSize);
    createTable(TableMetadataPersistence.SweepStrategy.CONSERVATIVE);
    long numInsertions = 100;
    insertMultipleValues(numInsertions);
    long sweepTimestamp = numInsertions + 1;
    SweepResults results = completeSweep(sweepTimestamp).get();
    Assert.assertEquals(numInsertions - 1, results.getStaleValuesDeleted());
}
Also used : SweepResults(com.palantir.atlasdb.keyvalue.api.SweepResults) AbstractSweepTaskRunnerTest(com.palantir.atlasdb.sweep.AbstractSweepTaskRunnerTest) Test(org.junit.Test)

Aggregations

SweepResults (com.palantir.atlasdb.keyvalue.api.SweepResults)27 Test (org.junit.Test)16 ImmutableSweepResults (com.palantir.atlasdb.keyvalue.api.ImmutableSweepResults)15 Cell (com.palantir.atlasdb.keyvalue.api.Cell)4 TableReference (com.palantir.atlasdb.keyvalue.api.TableReference)4 List (java.util.List)4 ImmutableList (com.google.common.collect.ImmutableList)3 ImmutableSweepBatchConfig (com.palantir.atlasdb.sweep.ImmutableSweepBatchConfig)3 SweepBatchConfig (com.palantir.atlasdb.sweep.SweepBatchConfig)3 SweepTaskRunner (com.palantir.atlasdb.sweep.SweepTaskRunner)3 ArrayList (java.util.ArrayList)3 Stopwatch (com.google.common.base.Stopwatch)2 AtlasDbConstants (com.palantir.atlasdb.AtlasDbConstants)2 PtBytes (com.palantir.atlasdb.encoding.PtBytes)2 LoggingArgs (com.palantir.atlasdb.logging.LoggingArgs)2 AbstractSweepTaskRunnerTest (com.palantir.atlasdb.sweep.AbstractSweepTaskRunnerTest)2 UnsafeArg (com.palantir.logsafe.UnsafeArg)2 Arrays (java.util.Arrays)2 Optional (java.util.Optional)2 TimeUnit (java.util.concurrent.TimeUnit)2