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

jiaguo 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 5fa1cf4e18 refactor get table from tenant, so that we also get tables 
that have tag overwrite (#15009)
5fa1cf4e18 is described below

commit 5fa1cf4e1861428e49b3f07dce5bff6a8ab06505
Author: Jia Guo <jia...@linkedin.com>
AuthorDate: Fri Feb 7 15:31:44 2025 -0800

    refactor get table from tenant, so that we also get tables that have tag 
overwrite (#15009)
    
    * refactor get table from tenant, so that we also get tables that have tag 
overwrite
    
    * import
---
 .../api/resources/PinotTenantRestletResource.java       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
index 525ba828f6..2f2e9c51b9 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
@@ -388,12 +388,29 @@ public class PinotTenantRestletResource {
       if (tenantName.equals(tableConfigTenant)) {
         tables.add(table);
       }
+      if (tableConfig.getTenantConfig().getTagOverrideConfig() != null) {
+        String completed = 
tableConfig.getTenantConfig().getTagOverrideConfig().getRealtimeCompleted();
+        if (completed != null && 
getRawTenantName(completed).equals(tenantName)) {
+          tables.add(table);
+        }
+        String consuming = 
tableConfig.getTenantConfig().getTagOverrideConfig().getRealtimeConsuming();
+        if (consuming != null && 
getRawTenantName(consuming).equals(tenantName)) {
+          tables.add(table);
+        }
+      }
     }
 
     resourceGetRet.set(TABLES, JsonUtils.objectToJsonNode(tables));
     return resourceGetRet.toString();
   }
 
+  private String getRawTenantName(String tenantName) {
+    if (tenantName.lastIndexOf("_") > 0) {
+      return tenantName.substring(0, tenantName.lastIndexOf("_"));
+    }
+    return tenantName;
+  }
+
   private String getTablesServedFromBrokerTenant(String tenantName, @Nullable 
String database) {
     Set<String> tables = new HashSet<>();
     ObjectNode resourceGetRet = JsonUtils.newObjectNode();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to