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

raghavyadav01 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new b916e5474c9 Extract task-type table filter into overridable 
PinotTaskManager method (#19463)
b916e5474c9 is described below

commit b916e5474c95fa07b20ee385d8067677c285e01f
Author: Chaitanya Deepthi <[email protected]>
AuthorDate: Fri Sep 4 14:48:06 2026 -0700

    Extract task-type table filter into overridable PinotTaskManager method 
(#19463)
    
    Move the inline scan in PinotTableRestletResource#listTables that filters
    tables by taskType into a new public method
    PinotTaskManager#getTablesForTaskType, so distributions can override to
    include tables enabled via mechanisms beyond the persisted
    taskTypeConfigsMap (e.g. implicit defaults).
---
 .../controller/api/resources/PinotTableRestletResource.java | 10 +---------
 .../controller/helix/core/minion/PinotTaskManager.java      | 13 +++++++++++++
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
index 6dff8b7eee6..345f9f19fbd 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
@@ -504,15 +504,7 @@ public class PinotTableRestletResource {
                       : 
_pinotHelixResourceManager.getAllOfflineTables(database));
 
       if (StringUtils.isNotBlank(taskType)) {
-        Set<String> tableNamesForTaskType = new HashSet<>();
-        for (String tableNameWithType : tableNamesWithType) {
-          TableConfig tableConfig = 
_pinotHelixResourceManager.getTableConfig(tableNameWithType);
-          if (tableConfig != null && tableConfig.getTaskConfig() != null && 
tableConfig.getTaskConfig()
-              .isTaskTypeEnabled(taskType)) {
-            tableNamesForTaskType.add(tableNameWithType);
-          }
-        }
-        tableNamesWithType.retainAll(tableNamesForTaskType);
+        
tableNamesWithType.retainAll(_pinotTaskManager.getTablesForTaskType(taskType, 
tableNamesWithType));
       }
 
       List<String> tableNames;
diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java
index 03385d1ff06..4f22b0ebff9 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java
@@ -726,6 +726,19 @@ public class PinotTaskManager extends 
ControllerPeriodicTask<Void> {
     return _taskGeneratorRegistry;
   }
 
+  /// Return the subset of [candidateTables] that have [taskType] enabled.
+  public Set<String> getTablesForTaskType(String taskType, Collection<String> 
candidateTables) {
+    Set<String> tables = new HashSet<>();
+    for (String tableNameWithType : candidateTables) {
+      TableConfig tableConfig = 
_pinotHelixResourceManager.getTableConfig(tableNameWithType);
+      if (tableConfig != null && tableConfig.getTaskConfig() != null
+          && tableConfig.getTaskConfig().isTaskTypeEnabled(taskType)) {
+        tables.add(tableNameWithType);
+      }
+    }
+    return tables;
+  }
+
   /// Registers a task generator.
   ///
   /// This method can be used to plug in custom task generators.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to