public final class PushReplicationEvent<T> extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
PushReplicationEvent.OffsetPayload
A payload carrying a single offset value.
|
static class |
PushReplicationEvent.RecordsPayload
A payload carrying an
AbstractRecords representing 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 class |
PushReplicationEvent.StopPayload
A payload for a
PushReplicationEvent.Type.STOP_PUSH event, indicating whether the end of the push session
should be signalled to the corresponding follower. |
static class |
PushReplicationEvent.Type
Enumerates the different types of push replication events.
|
Modifier and Type | Method and Description |
---|---|
long |
eventCreatedTimeMs() |
static PushReplicationEvent<PushReplicationEvent.OffsetPayload> |
forHighWatermarkUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition,
int replicaId,
long updatedHighWatermark,
long eventCreatedTimeMs)
Creates a new event of type
PushReplicationEvent.Type.HWM_UPDATE with its payload being an
PushReplicationEvent.OffsetPayload containing the updated high watermark. |
static PushReplicationEvent<PushReplicationEvent.OffsetPayload> |
forLogStartOffsetUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition,
int replicaId,
long updatedLogStartOffset,
long eventCreatedTimeMs)
Creates a new event of type
PushReplicationEvent.Type.LSO_UPDATE with its payload being an
PushReplicationEvent.OffsetPayload containing the updated log start offset. |
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 type
PushReplicationEvent.Type.MEMORY_RECORDS with its payload
being a PushReplicationEvent.RecordsPayload containing 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 type
PushReplicationEvent.Type.START_PUSH with its payload being the given
PushSession . |
static PushReplicationEvent<PushReplicationEvent.StopPayload> |
forStopPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition,
int replicaId,
boolean sendEndSessionRequest,
long eventCreatedTimeMs)
Creates a new event of type
PushReplicationEvent.Type.STOP_PUSH with its payload being an
PushReplicationEvent.StopPayload . |
T |
payload()
The payload carried by this push replication event.
|
int |
replicaId() |
org.apache.kafka.server.common.TopicIdPartition |
topicIdPartition() |
String |
toString() |
PushReplicationEvent.Type |
type()
The type of this push replication event.
|
public static PushReplicationEvent<PushSession> forStartPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, PushSession pushSession, long eventCreatedTimeMs)
PushReplicationEvent.Type.START_PUSH
with its payload being the given
PushSession
.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)
PushReplicationEvent.Type.MEMORY_RECORDS
with its payload
being a PushReplicationEvent.RecordsPayload
containing the given records and offsets.public static PushReplicationEvent<PushReplicationEvent.OffsetPayload> forHighWatermarkUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, long updatedHighWatermark, long eventCreatedTimeMs)
PushReplicationEvent.Type.HWM_UPDATE
with its payload being an
PushReplicationEvent.OffsetPayload
containing the updated high watermark.public static PushReplicationEvent<PushReplicationEvent.OffsetPayload> forLogStartOffsetUpdate(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, long updatedLogStartOffset, long eventCreatedTimeMs)
PushReplicationEvent.Type.LSO_UPDATE
with its payload being an
PushReplicationEvent.OffsetPayload
containing the updated log start offset.public static PushReplicationEvent<PushReplicationEvent.StopPayload> forStopPush(org.apache.kafka.server.common.TopicIdPartition topicIdPartition, int replicaId, boolean sendEndSessionRequest, long eventCreatedTimeMs)
PushReplicationEvent.Type.STOP_PUSH
with its payload being an
PushReplicationEvent.StopPayload
.public org.apache.kafka.server.common.TopicIdPartition topicIdPartition()
public int replicaId()
public T payload()
public PushReplicationEvent.Type type()
PushReplicationEvent.Type
public long eventCreatedTimeMs()