danielcweeks commented on code in PR #14510:
URL: https://github.com/apache/iceberg/pull/14510#discussion_r2505651857


##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/Coordinator.java:
##########
@@ -288,6 +289,32 @@ private void commitToTable(
     }
   }
 
+  private SnapshotAncestryValidator offsetValidator(
+      TableIdentifier tableIdentifier, Map<Integer, Long> expectedOffsets) {
+
+    return new SnapshotAncestryValidator() {
+      private Map<Integer, Long> lastCommittedOffsets;
+
+      @Override
+      public Boolean apply(Iterable<Snapshot> baseSnapshots) {
+        lastCommittedOffsets = lastCommittedOffsets(baseSnapshots);
+
+        if (expectedOffsets.isEmpty() && lastCommittedOffsets.isEmpty()) {
+          return true; // there are no stored offsets, so assume we're 
starting with new offsets
+        }

Review Comment:
   With the most recent changes, I agree with @singhpk234 on this.  It's now 
pretty much down to "they must always be equal" (whether there are any or not). 
 Which I think may take a moment to think through, but is pretty obvious as a 
constraint.



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

Reply via email to