[ 
https://issues.apache.org/jira/browse/KAFKA-4322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15671093#comment-15671093
 ] 

Guozhang Wang commented on KAFKA-4322:
--------------------------------------

Thanks [~markshelton], the reason I mentioned a KIP proposal is that we seem 
have different opinions (having a callback, or rather just adding the metrics / 
log entries) on this issue, and KIP discussion was designed for such cases 
where people can speak out openly and bring community's attention to any 
changes to public APIs.

Given your use case, I'm wondering if it would OK to just adding logging to 
record how many keys were restored and also metrics regarding restoration, 
instead of adding a generalized callback? If in the future we observed other 
use cases that can be captured in a callback I'm more than happy to propose the 
KIP myself and push this change to public APIs, since after all it is easier to 
add a new function later than adding the function now and reverting it for 
simplicity.

> StateRestoreCallback begin and end indication
> ---------------------------------------------
>
>                 Key: KAFKA-4322
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4322
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>    Affects Versions: 0.10.1.0
>            Reporter: Mark Shelton
>            Assignee: Mark Shelton
>            Priority: Minor
>
> In Kafka Streams, the StateRestoreCallback interface provides only a single 
> method "restore(byte[] key, byte[] value)" that is called for every key-value 
> pair to be restored. 
> It would be nice to have "beginRestore" and "endRestore" methods as part of 
> StateRestoreCallback.
> Kafka Streams would call "beginRestore" before restoring any keys, and would 
> call "endRestore" when it determines that it is done. This allows an 
> implementation, for example, to report on the number of keys restored and 
> perform a commit after the last key was restored. Other uses are conceivable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to