tomstepp commented on code in PR #33596:
URL: https://github.com/apache/beam/pull/33596#discussion_r1931297981


##########
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:
   Took a stab at it, please let me know if you had something else in mind.



##########
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:
   Took a stab at it, please let me know if you had something else in mind.



-- 
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]

Reply via email to