public class CompositeRestoreListener extends java.lang.Object implements RecordBatchingStateRestoreCallback, StateRestoreListener
Modifier and Type | Field and Description |
---|---|
static org.apache.kafka.streams.processor.internals.CompositeRestoreListener.NoOpStateRestoreListener |
NO_OP_STATE_RESTORE_LISTENER |
Modifier and Type | Method and Description |
---|---|
void |
onBatchRestored(org.apache.kafka.common.TopicPartition topicPartition,
java.lang.String storeName,
long batchEndOffset,
long numRestored)
Method called after restoring a batch of records.
|
void |
onRestoreEnd(org.apache.kafka.common.TopicPartition topicPartition,
java.lang.String storeName,
long totalRestored)
Method called when restoring the
StateStore is complete. |
void |
onRestoreStart(org.apache.kafka.common.TopicPartition topicPartition,
java.lang.String storeName,
long startingOffset,
long endingOffset)
Method called at the very beginning of
StateStore restoration. |
void |
restore(byte[] key,
byte[] value) |
void |
restoreAll(java.util.Collection<KeyValue<byte[],byte[]>> records)
Called to restore a number of records.
|
void |
restoreBatch(java.util.Collection<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>> records) |
public static final org.apache.kafka.streams.processor.internals.CompositeRestoreListener.NoOpStateRestoreListener NO_OP_STATE_RESTORE_LISTENER
public void onRestoreStart(org.apache.kafka.common.TopicPartition topicPartition, java.lang.String storeName, long startingOffset, long endingOffset)
StateRestoreListener
StateStore
restoration.onRestoreStart
in interface StateRestoreListener
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 TopicPartitionStreamsException
- if user provided StateRestoreListener
raises an exception in
StateRestoreListener.onRestoreStart(TopicPartition, String, long, long)
public void onBatchRestored(org.apache.kafka.common.TopicPartition topicPartition, java.lang.String storeName, long batchEndOffset, long numRestored)
StateRestoreListener
onBatchRestored
in interface StateRestoreListener
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 TopicPartitionStreamsException
- if user provided StateRestoreListener
raises an exception in
StateRestoreListener.onBatchRestored(TopicPartition, String, long, long)
public void onRestoreEnd(org.apache.kafka.common.TopicPartition topicPartition, java.lang.String storeName, long totalRestored)
StateRestoreListener
StateStore
is complete.onRestoreEnd
in interface StateRestoreListener
topicPartition
- the TopicPartition containing the values to restorestoreName
- the name of the store just restoredtotalRestored
- the total number of records restored for this TopicPartitionStreamsException
- if user provided StateRestoreListener
raises an exception in
StateRestoreListener.onRestoreEnd(TopicPartition, String, long)
public void restoreBatch(java.util.Collection<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>> records)
restoreBatch
in interface RecordBatchingStateRestoreCallback
public void restoreAll(java.util.Collection<KeyValue<byte[],byte[]>> records)
BatchingStateRestoreCallback
StateStore
is fulled
restored.restoreAll
in interface BatchingStateRestoreCallback
restoreAll
in interface RecordBatchingStateRestoreCallback
records
- the records to restore.public void restore(byte[] key, byte[] value)
restore
in interface RecordBatchingStateRestoreCallback
restore
in interface StateRestoreCallback