jmckenzie-dev commented on code in PR #178:
URL: 
https://github.com/apache/cassandra-analytics/pull/178#discussion_r2942100564


##########
cassandra-analytics-cdc/src/main/java/org/apache/cassandra/cdc/api/EventConsumer.java:
##########
@@ -25,4 +25,17 @@
 
 public interface EventConsumer extends Consumer<CdcEvent>
 {
+    /**
+     * Flush any pending events to the transport layer.
+     * Called after each micro-batch and before CDC state is persisted, to 
ensure
+     * all events have been durably delivered before the commit-log position 
advances.
+     * If delivery fails, implementations must throw so that state is NOT 
persisted
+     * and the micro-batch will be retried on the next run.
+     *
+     * @throws InterruptedException if the calling thread is interrupted while 
flushing
+     */
+    default void flush() throws InterruptedException

Review Comment:
   I think the `flush` method better lives in the public interface of the 
`StatePersister` -> if our goal is to say "anything that persists state allows 
an external user to tell it to actively persist that state in a synchronous 
blocking way", that is consistent with/the existing API and usage patterns. 
wdyt?



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