vvcephei commented on a change in pull request #11676:
URL: https://github.com/apache/kafka/pull/11676#discussion_r793212425



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/ProcessorContext.java
##########
@@ -85,8 +85,23 @@
      * @throws IllegalStateException If store gets registered after 
initialized is already finished
      * @throws StreamsException if the store's change log does not contain the 
partition
      */
+    default void register(final StateStore store,
+                  final StateRestoreCallback stateRestoreCallback) {
+        register(store, stateRestoreCallback, null);
+    }
+
+    /**
+     * Register and possibly restores the specified storage engine.
+     *
+     * @param store the storage engine
+     * @param stateRestoreCallback the restoration callback logic for 
log-backed state stores upon restart
+     * @param checkpointCallback called to checkpoint position metatadata of 
state stores
+     *
+     * @throws IllegalStateException If store gets registered after 
initialized is already finished
+     * @throws StreamsException if the store's change log does not contain the 
partition
+     */
     void register(final StateStore store,
-                  final StateRestoreCallback stateRestoreCallback);
+                  final StateRestoreCallback stateRestoreCallback, final 
CheckpointCallback checkpointCallback);

Review comment:
       Thanks for that naming suggestion, @guozhangwang ! I agree that "commit" 
is a much better term than "checkpoint".
   
   Regarding your larger point, I agree that there's a burden on store 
maintainers to track the position correctly and to integrate correctly with 
state restoration and checkpointing. I think that we can probably address the 
burden of this API without sacrificing the precise correctness of position 
tracking. As you mentioned, it'll be easier to consider an alternative as a 
follow-on PR instead of continuing to revise this one, though. I'll file a 
ticket shortly to circle back on this issue before the next release.




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