Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Fix ClassInitializationDeadlock #5226

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,7 +74,7 @@ protected MultiTableSweepQueueWriter getSweepQueueWriterInitialized() {
keyValueService,
timelockService,
() -> 128,
ReadBatchingRuntimeContext.DEFAULT);
ReadBatchingRuntimeContexts.DEFAULT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down