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

Mark Shelton commented on KAFKA-10410:
--------------------------------------

My implementation of StateRestoreCallback needs to know when the state restore 
starts and when it ends. This is because it needs to handle statistics, 
transaction stuff and cleanup. In version 2.5 and earlier this was easy as the 
methods were already there on {{AbstractNotifyingRestoreCallback.}}

With version 2.6 only the "StateRestoreListener", which is per streams 
instance, receives the "onRestartStart" and "onRestartEnd". Since the 
"StateRestoreListener" is per streams instance there is no easy way for it to 
notify any StateRestoreCallback instance(s).

In version 2.5 and earlier the following was available and convenient. But 
since {{AbstractNotifyingRestoreCallback}} is removed the update to version 2.6 
is a show stopper.

{{public class MyStateRestoreCallback extends AbstractNotifyingRestoreCallback 
{}}
{{}}

{{  @Override}}
{{   public void onRestoreStart(TopicPartition topicPartition, String 
storeName, long startingOffset, long endingOffset) {}}

{{    // called by Kafka Streams}}
{{  }}}

{{  @Override}}
{{   public void onRestoreEnd(TopicPartition topicPartition, String storeName, 
long totalRestored) {}}
{{    // called by Kafka Streams}}{{}}

{{  }}}

{{...}}

{{}}}

 

> OnRestoreStart disappeared from StateRestoreCallback  in 2.6.0 and reappeared 
> in a useless place
> ------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-10410
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10410
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.6.0
>            Reporter: Mark Shelton
>            Priority: Blocker
>
> In version 2.5.0 and earlier there are "onRestoreStart" and "onRestoreEnd" 
> methods on StateRestoreCallback.
> Version 2.6.0 removed these calls and put them into StateRestoreListener and 
> requires "streaming.setGlobalStateRestoreListener".
> This makes it impossible for the actual StateRestoreCallback implementation 
> to receive the start and end indication and is blocking me from moving to 
> 2.6.0.
> See:
> [https://kafka.apache.org/25/javadoc/index.html?org/apache/kafka/streams/processor/AbstractNotifyingRestoreCallback.html]
>  
> Related JIRA:
> https://issues.apache.org/jira/browse/KAFKA-4322 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to