This is an automated email from the ASF dual-hosted git repository.

dimas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 0b54f7046 Use typed config for `TABLE_METADATA_CLEANUP_BATCH_SIZE` 
(#3478)
0b54f7046 is described below

commit 0b54f7046295ff19d434f9f0bd47b0b612be51a5
Author: Dmitri Bourlatchkov <[email protected]>
AuthorDate: Tue Jan 20 13:21:34 2026 -0500

    Use typed config for `TABLE_METADATA_CLEANUP_BATCH_SIZE` (#3478)
    
    Add a typed `FeatureConfiguration` with the same config name and default 
value.
---
 .../java/org/apache/polaris/core/config/FeatureConfiguration.java  | 7 +++++++
 .../org/apache/polaris/service/task/TableCleanupTaskHandler.java   | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java
index 1eb121c49..70a5f4094 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java
@@ -516,4 +516,11 @@ public class FeatureConfiguration<T> extends 
PolarisConfiguration<T> {
                   + "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();
 }
diff --git 
a/runtime/service/src/main/java/org/apache/polaris/service/task/TableCleanupTaskHandler.java
 
b/runtime/service/src/main/java/org/apache/polaris/service/task/TableCleanupTaskHandler.java
index 54976dead..cd8e5b5a3 100644
--- 
a/runtime/service/src/main/java/org/apache/polaris/service/task/TableCleanupTaskHandler.java
+++ 
b/runtime/service/src/main/java/org/apache/polaris/service/task/TableCleanupTaskHandler.java
@@ -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;
@@ -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,
@@ -208,7 +209,7 @@ public class TableCleanupTaskHandler implements TaskHandler 
{
       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 -> {

Reply via email to