xiangfu0 commented on code in PR #20168:
URL: https://github.com/apache/pinot/pull/20168#discussion_r4522452415
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -527,13 +528,26 @@ private static boolean isValidPeerDownloadScheme(String
peerSegmentDownloadSchem
||
CommonConstants.HTTPS_PROTOCOL.equalsIgnoreCase(peerSegmentDownloadScheme);
}
+ /// Returns whether the stored table config is already pauseless and sets
`key` to `value` in one of its stream
+ /// configs. This value stays valid, so that updates to an existing table
and to its schema keep working.
+ private static boolean hasSamePauselessTimeFlushThreshold(@Nullable
TableConfig existingTableConfig, String key,
+ String value) {
+ if (existingTableConfig == null ||
!PauselessConsumptionUtils.isPauselessEnabled(existingTableConfig)) {
+ return false;
+ }
+ // Pauseless consumption is enabled in the stream ingestion config, so the
ingestion config is not null
+ return
existingTableConfig.getIngestionConfig().getStreamIngestionConfig().getStreamConfigMaps().stream()
+ .anyMatch(streamConfigMap -> value.equals(streamConfigMap.get(key)));
Review Comment:
Nit: `anyMatch` checks every stored stream config, not the matching one. So
a multi-stream pauseless table whose stream A has `30m` can add the same `30m`
to stream B or a new stream, and it passes. That is rare, but if you want the
exemption to be exact, you could compare by index, or require that the key was
already present in the stream being validated.
--
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]