Class PushReplicationEvent<T>
java.lang.Object
io.confluent.kafka.replication.push.buffer.PushReplicationEvent<T>
A generic event representing a partition replica change that should be processed for the purposes of push replication.
There are different types of these events corresponding to starting push replication, stopping push replication, the various types of partition updates - a newly appended records batch, an updated HWM, or an updated LSO that might be needed to have a follower catch up.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA payload carrying a single offset value.static classA payload carrying anAbstractRecordsrepresenting some records already appended on the partition replica leader, their append offset, and the high watermark value at the time of creating the records.static enumEnumerates the different types of push replication events. -
Method Summary
Modifier and TypeMethodDescriptionlongforHighWatermarkUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, long updatedHighWatermark, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.HWM_UPDATEwith its payload being anPushReplicationEvent.OffsetPayloadcontaining the updated high watermark.forLogStartOffsetUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, long updatedLogStartOffset, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.LSO_UPDATEwith its payload being anPushReplicationEvent.OffsetPayloadcontaining the updated log start offset.forRecords(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, org.apache.kafka.common.record.AbstractRecords records, long appendOffset, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.MEMORY_RECORDSwith its payload being aPushReplicationEvent.RecordsPayloadcontaining the given records and offsets.static PushReplicationEvent<PushSession> forStartPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, PushSession pushSession, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.START_PUSHwith its payload being the givenPushSession.forStopPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, PushSessionEndReason pushSessionEndReason, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.STOP_PUSHwith its payload being aPushSessionEndReason.payload()The payload carried by this push replication event.intorg.apache.kafka.server.common.TopicIdPartitiontoString()type()The type of this push replication event.
-
Method Details
-
forStartPush
public static PushReplicationEvent<PushSession> forStartPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, PushSession pushSession, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.START_PUSHwith its payload being the givenPushSession. -
forRecords
public static PushReplicationEvent<PushReplicationEvent.RecordsPayload> forRecords(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, org.apache.kafka.common.record.AbstractRecords records, long appendOffset, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.MEMORY_RECORDSwith its payload being aPushReplicationEvent.RecordsPayloadcontaining the given records and offsets. -
forHighWatermarkUpdate
public static PushReplicationEvent<PushReplicationEvent.OffsetPayload> forHighWatermarkUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, long updatedHighWatermark, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.HWM_UPDATEwith its payload being anPushReplicationEvent.OffsetPayloadcontaining the updated high watermark. -
forLogStartOffsetUpdate
public static PushReplicationEvent<PushReplicationEvent.OffsetPayload> forLogStartOffsetUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, long updatedLogStartOffset, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.LSO_UPDATEwith its payload being anPushReplicationEvent.OffsetPayloadcontaining the updated log start offset. -
forStopPush
public static PushReplicationEvent<PushSessionEndReason> forStopPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, PushSessionEndReason pushSessionEndReason, long eventCreatedTimeMs) Creates a new event of typePushReplicationEvent.Type.STOP_PUSHwith its payload being aPushSessionEndReason. -
topicIdPartition
public org.apache.kafka.server.common.TopicIdPartition topicIdPartition() -
replicaId
public int replicaId() -
payload
The payload carried by this push replication event. The exact type of the payload depends on the exact type of the event. -
type
The type of this push replication event.- See Also:
-
eventCreatedTimeMs
public long eventCreatedTimeMs() -
toString
-