Skip to content
Merged
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 @@ -516,4 +516,11 @@ public static void enforceFeatureEnabledOrThrow(
+ "Helps prevent thundering herd when multiple requests fail simultaneously.")
.defaultValue(0.5)
.buildFeatureConfiguration();

public static final FeatureConfiguration<Integer> TABLE_METADATA_CLEANUP_BATCH_SIZE =
PolarisConfiguration.<Integer>builder()
.key("TABLE_METADATA_CLEANUP_BATCH_SIZE")
.description("Metadata batch size for tasks that clean up dropped tables' files.")
.defaultValue(10)
.buildFeatureConfiguration();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.polaris.service.task;

import static org.apache.polaris.core.config.FeatureConfiguration.TABLE_METADATA_CLEANUP_BATCH_SIZE;

import java.time.Clock;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -56,7 +58,6 @@ public class TableCleanupTaskHandler implements TaskHandler {
private final Clock clock;
private final MetaStoreManagerFactory metaStoreManagerFactory;
private final TaskFileIOSupplier fileIOSupplier;
private static final String BATCH_SIZE_CONFIG_KEY = "TABLE_METADATA_CLEANUP_BATCH_SIZE";

public TableCleanupTaskHandler(
TaskExecutor taskExecutor,
Expand Down Expand Up @@ -208,7 +209,7 @@ private Stream<TaskEntity> getMetadataTaskStream(
PolarisMetaStoreManager metaStoreManager,
CallContext callContext) {
PolarisCallContext polarisCallContext = callContext.getPolarisCallContext();
int batchSize = callContext.getRealmConfig().getConfig(BATCH_SIZE_CONFIG_KEY, 10);
int batchSize = callContext.getRealmConfig().getConfig(TABLE_METADATA_CLEANUP_BATCH_SIZE);
return getMetadataFileBatches(tableMetadata, batchSize).stream()
.map(
metadataBatch -> {
Expand Down