public interface StateRestoreListener
KafkaStreams.setGlobalStateRestoreListener(StateRestoreListener)
the passed instance is expected to be stateless since the StateRestoreListener
is shared
across all StreamThread
instances.
Users desiring stateful operations will need to provide synchronization internally in
the StateRestorerListener
implementation.
When used for monitoring a single StateStore
using either AbstractNotifyingRestoreCallback
or
AbstractNotifyingBatchingRestoreCallback
no synchronization is necessary
as each StreamThread has its own StateStore instance.
Incremental updates are exposed so users can estimate how much progress has been made.Modifier and Type | Method and Description |
---|---|
void |
onBatchRestored(TopicPartition topicPartition,
String storeName,
long batchEndOffset,
long numRestored)
Method called after restoring a batch of records.
|
void |
onRestoreEnd(TopicPartition topicPartition,
String storeName,
long totalRestored)
Method called when restoring the
StateStore is complete. |
void |
onRestoreStart(TopicPartition topicPartition,
String storeName,
long startingOffset,
long endingOffset)
Method called at the very beginning of
StateStore restoration. |
void onRestoreStart(TopicPartition topicPartition, String storeName, long startingOffset, long endingOffset)
StateStore
restoration.topicPartition
- the TopicPartition containing the values to restorestoreName
- the name of the store undergoing restorationstartingOffset
- the starting offset of the entire restoration process for this TopicPartitionendingOffset
- the exclusive ending offset of the entire restoration process for this TopicPartitionvoid onBatchRestored(TopicPartition topicPartition, String storeName, long batchEndOffset, long numRestored)
topicPartition
- the TopicPartition containing the values to restorestoreName
- the name of the store undergoing restorationbatchEndOffset
- the inclusive ending offset for the current restored batch for this TopicPartitionnumRestored
- the total number of records restored in this batch for this TopicPartitionvoid onRestoreEnd(TopicPartition topicPartition, String storeName, long totalRestored)
StateStore
is complete.topicPartition
- the TopicPartition containing the values to restorestoreName
- the name of the store just restoredtotalRestored
- the total number of records restored for this TopicPartition