public interface StandbyUpdateListener
Modifier and Type | Interface and Description |
---|---|
static class |
StandbyUpdateListener.SuspendReason |
Modifier and Type | Method and Description |
---|---|
void |
onBatchLoaded(org.apache.kafka.common.TopicPartition topicPartition,
String storeName,
TaskId taskId,
long batchEndOffset,
long batchSize,
long currentEndOffset)
Method called after loading a batch of records.
|
void |
onUpdateStart(org.apache.kafka.common.TopicPartition topicPartition,
String storeName,
long startingOffset)
A callback that will be invoked after registering the changelogs for each state store in a standby
task.
|
void |
onUpdateSuspended(org.apache.kafka.common.TopicPartition topicPartition,
String storeName,
long storeOffset,
long currentEndOffset,
StandbyUpdateListener.SuspendReason reason)
This method is called when the corresponding standby task stops updating, for the provided reason.
|
void onUpdateStart(org.apache.kafka.common.TopicPartition topicPartition, String storeName, long startingOffset)
topicPartition
- the changelog TopicPartition for this standby taskstoreName
- the name of the store being loadedstartingOffset
- the offset from which the standby task begins consuming from the changelogvoid onBatchLoaded(org.apache.kafka.common.TopicPartition topicPartition, String storeName, TaskId taskId, long batchEndOffset, long batchSize, long currentEndOffset)
topicPartition
- the changelog TopicPartition for this standby taskstoreName
- the name of the store being loadedbatchEndOffset
- batchEndOffset the changelog end offset (inclusive) of the batch that was just loadedbatchSize
- the total number of records in the batch that was just loadedcurrentEndOffset
- the current end offset of the changelog topic partition.void onUpdateSuspended(org.apache.kafka.common.TopicPartition topicPartition, String storeName, long storeOffset, long currentEndOffset, StandbyUpdateListener.SuspendReason reason)
If the task was MIGRATED
to another instance, this callback will be invoked after this
state store (and the task itself) are closed (in which case the data will be cleaned up after
state.cleanup.delay.ms).
If the task was PROMOTED
to an active task, the state store will not be closed, and the
callback will be invoked after unregistering it as a standby task but before re-registering it as an active task
and beginning restoration. In other words, this will always called before the corresponding
StateRestoreListener.onRestoreStart(org.apache.kafka.common.TopicPartition, java.lang.String, long, long)
call is made.
topicPartition
- the changelog TopicPartition for this standby taskstoreName
- the name of the store being loadedstoreOffset
- is the offset of the last changelog record that was read and put into the store at the time
of suspension.currentEndOffset
- the current end offset of the changelog topic partition.reason
- is the reason why the standby task was suspended.