diff --git a/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKvsSerializableTransactionTest.java b/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKvsSerializableTransactionTest.java index a1204b97822..f834acdeed5 100644 --- a/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKvsSerializableTransactionTest.java +++ b/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKvsSerializableTransactionTest.java @@ -20,8 +20,8 @@ import com.palantir.atlasdb.containers.CassandraResource; import com.palantir.atlasdb.sweep.metrics.TargetedSweepMetrics; import com.palantir.atlasdb.sweep.queue.MultiTableSweepQueueWriter; +import com.palantir.atlasdb.sweep.queue.ReadBatchingRuntimeContexts; import com.palantir.atlasdb.sweep.queue.SweepQueue; -import com.palantir.atlasdb.sweep.queue.SweepQueueReader.ReadBatchingRuntimeContext; import com.palantir.atlasdb.sweep.queue.TargetedSweeper; import com.palantir.atlasdb.transaction.api.Transaction; import com.palantir.atlasdb.transaction.impl.AbstractSerializableTransactionTest; @@ -74,7 +74,7 @@ protected MultiTableSweepQueueWriter getSweepQueueWriterInitialized() { keyValueService, timelockService, () -> 128, - ReadBatchingRuntimeContext.DEFAULT); + ReadBatchingRuntimeContexts.DEFAULT); } @Override diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/ReadBatchingRuntimeContexts.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/ReadBatchingRuntimeContexts.java new file mode 100644 index 00000000000..053f9488868 --- /dev/null +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/ReadBatchingRuntimeContexts.java @@ -0,0 +1,28 @@ +/* + * (c) Copyright 2021 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.atlasdb.sweep.queue; + +import com.palantir.atlasdb.sweep.queue.SweepQueueReader.ReadBatchingRuntimeContext; + +public final class ReadBatchingRuntimeContexts { + private ReadBatchingRuntimeContexts() {} + + public static final ReadBatchingRuntimeContext DEFAULT = ReadBatchingRuntimeContext.builder() + .maximumPartitions(() -> 1) + .cellsThreshold(() -> SweepQueueUtils.SWEEP_BATCH_SIZE) + .build(); +} diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueueReader.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueueReader.java index 05ccd74d167..ec08e9512df 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueueReader.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueueReader.java @@ -54,7 +54,9 @@ SweepBatchWithPartitionInfo getNextBatchToSweep(ShardAndStrategy shardStrategy, } @Immutable + @SuppressWarnings("ClassInitializationDeadlock") public interface ReadBatchingRuntimeContext { + @Deprecated ReadBatchingRuntimeContext DEFAULT = ReadBatchingRuntimeContext.builder() .maximumPartitions(() -> 1) .cellsThreshold(() -> SweepQueueUtils.SWEEP_BATCH_SIZE)