Naireen commented on code in PR #32344:
URL: https://github.com/apache/beam/pull/32344#discussion_r1762011686
##########
sdks/java/io/kafka/src/test/java/org/apache/beam/sdk/io/kafka/KafkaIOTest.java:
##########
@@ -648,6 +669,29 @@ public void
testCommitOffsetsInFinalizeAndRedistributeWarnings() {
"Offsets committed due to usage of commitOffsetsInFinalize() may not
capture all work processed due to use of withRedistribute()");
}
+ @Test
+ public void
testCommitOffsetsInFinalizeAndRedistributeNoWarningsWithAllowDuplicates() {
Review Comment:
I do want to mention commits are enabled, since if we do not commit offsets,
enabling allow duplicates also has no warning.
updated test name to NoWarningsWithNoAllowDuplicatesAndCommitOffsets, and
updated the other test name so its more clear that the two are testing
behaviour with and without allowDuplicates=true.
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java:
##########
@@ -1696,7 +1696,7 @@ public PCollection<KafkaRecord<K, V>> expand(PBegin
input) {
}
if (kafkaRead.isRedistributed()) {
- if (kafkaRead.isCommitOffsetsInFinalizeEnabled()) {
+ if (kafkaRead.isCommitOffsetsInFinalizeEnabled() &&
kafkaRead.isAllowDuplicates()) {
LOG.warn(
"Offsets committed due to usage of commitOffsetsInFinalize()
may not capture all work processed due to use of withRedistribute()");
Review Comment:
Done.
--
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]