tomstepp commented on code in PR #33596:
URL: https://github.com/apache/beam/pull/33596#discussion_r1931268769
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java:
##########
@@ -1073,7 +1093,7 @@ public Read<K, V> withRedistribute() {
}
public Read<K, V> withAllowDuplicates(Boolean allowDuplicates) {
- if (!isAllowDuplicates()) {
+ if (!isRedistributed()) {
LOG.warn("Setting this value without setting withRedistribute() will
have no effect.");
Review Comment:
Would this be best done in `KafkaIO.Read.expand()`? Looks like there is
already a good amount of configuration checking done there. Or are you
referring to somewhere else?
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java:
##########
@@ -1086,6 +1106,17 @@ public Read<K, V> withRedistributeNumKeys(int
redistributeNumKeys) {
return toBuilder().setRedistributeNumKeys(redistributeNumKeys).build();
}
+ public Read<K, V> withOffsetDeduplication(boolean offsetDeduplication) {
+ /*
+ * TODO(tomstepp): Auto-enable offset deduplication if: redistributed
and !allowDuplicates.
+ * Until then, enforce explicit enablement only with redistributed
without duplicates.
+ */
+ checkState(
+ isRedistributed() && !isAllowDuplicates(),
Review Comment:
Would this be best done in `KafkaIO.Read.expand()`? Looks like there is
already a good amount of configuration checking done there. Or are you
referring to somewhere else?
--
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]