public class TierReplicaManager
extends java.lang.Object
addListener(kafka.tier.TierReplicaManager.ChangeListener)
and appropriate callbacks are fired for each lifecycle stage.
Notably, kafka.tier.tasks.TierTasks
registers listeners so it can track the set of partitions for which tiering
is enabled, and drive archiver and retention tasks based on that.Modifier and Type | Class and Description |
---|---|
static interface |
TierReplicaManager.ChangeListener
Interface to register callbacks on the lifecycle of tiering enabled topic partitions.
|
Constructor and Description |
---|
TierReplicaManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(TierReplicaManager.ChangeListener listener)
Register a change listener.
|
void |
becomeFollower(TierPartitionState tierPartitionState)
Called when replica becomes follower.
|
void |
becomeLeader(TierPartitionState tierPartitionState,
int leaderEpoch)
Called when replica is elected to be the leader.
|
void |
delete(TopicIdPartition topicIdPartition)
Called when the partition is deleted from this broker.
|
public void becomeLeader(TierPartitionState tierPartitionState, int leaderEpoch)
tierPartitionState
- Tier state file for partition becoming leaderleaderEpoch
- Leader epochpublic void becomeFollower(TierPartitionState tierPartitionState)
tierPartitionState
- Tier state file for partition becoming leaderpublic void delete(TopicIdPartition topicIdPartition)
topicIdPartition
- Topic partition being deletedpublic void addListener(TierReplicaManager.ChangeListener listener)
listener
- Listener to register