abhishekbafna commented on code in PR #15776:
URL: https://github.com/apache/pinot/pull/15776#discussion_r2094796646
##########
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:
There is a check for the realtime tables and skip the processing. In
directly check for offline tables and it is not throwing error.
Additional note, I had some discussion with @vrajat to add validation at the
time of table creation/update in a more generic way. Probably when we add
another time boundary approach, we would do it. So for now, added a skip check
for the realtime table.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]