abhishekbafna commented on code in PR #15776: URL: https://github.com/apache/pinot/pull/15776#discussion_r2095010181
########## pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java: ########## @@ -418,17 +420,74 @@ public synchronized void includeServerToRouting(String instanceId) { } /** - * Builds/rebuilds the routing for the physical table, for logical tables it is skipped. - * @param physicalOrLogicalTable a physical table with type or logical table name + * Builds the routing for a logical table. This method is called when a logical table is created or updated. + * @param logicalTableName the name of the logical table */ - public synchronized void buildRouting(String physicalOrLogicalTable) { - // skip route building for logical tables - if (ZKMetadataProvider.isLogicalTableExists(_propertyStore, physicalOrLogicalTable)) { - LOGGER.info("Skipping route building for logical table: {}", physicalOrLogicalTable); + public synchronized void buildRoutingForLogicalTable(String logicalTableName) { + LogicalTableConfig logicalTableConfig = ZKMetadataProvider.getLogicalTableConfig(_propertyStore, logicalTableName); + Preconditions.checkState(logicalTableConfig != null, "Failed to find logical table config for: %s", + logicalTableConfig); + if (!logicalTableConfig.isHybridLogicalTable()) { + LOGGER.info("Skip time boundary manager setting for non hybrid logical table: {}", logicalTableName); return; } - String tableNameWithType = physicalOrLogicalTable; + LOGGER.info("Setting time boundary manager for logical table: {}", logicalTableName); + + TimeBoundaryConfig timeBoundaryConfig = logicalTableConfig.getTimeBoundaryConfig(); + Preconditions.checkArgument(timeBoundaryConfig.getBoundaryStrategy().equals("min"), + "Invalid time boundary strategy: %s", timeBoundaryConfig.getBoundaryStrategy()); + List<String> includedTables = + (List<String>) timeBoundaryConfig.getParameters().getOrDefault("includedTables", List.of()); + + for (String tableNameWithType : includedTables) { Review Comment: Added a precondition check. Also created https://github.com/apache/pinot/issues/15834. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org