ableegoldman commented on code in PR #18152:
URL: https://github.com/apache/kafka/pull/18152#discussion_r1883112979
##########
streams/src/main/java/org/apache/kafka/streams/internals/AutoOffsetResetInternal.java:
##########
@@ -31,6 +31,13 @@ public StrategyType offsetResetStrategy() {
return offsetResetStrategy;
}
+ // calling `Optional.get()` w/o checking `isPresent()` results in a
warning that we suppress
+ // (there is unfortunately no speficif suppression for `Optional.get()`
warnings)
+ //
+ // we do call `get()` unconditionally on purpose here, as it should only
be called before `offsetResetStrategy()`
+ // was used to verify that the strategy is "by_duration"
+ // if the strategy is not "by_duration" and `duration()` is called,
+ // we want to fail right away to surface the bug in the caller code
Review Comment:
Specifically it will be helpful to say in the error message that this should
always be present when the strategy is duration, and then log the actual
strategy so we can tell if the bug was using this API on another strategy or a
failure to set the duration. Just trying to imagine what would be helpful to
know if this ever showed up in a JIRA ticket 🤷♀️
--
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]