Class PushSession
java.lang.Object
io.confluent.kafka.replication.push.PushSession
Identifies a push replication session for some partition replica. In addition to the session
identifiers (leader epoch, replica epoch, replication session ID), it also contains callbacks
for session-related updates - one called whenever an AppendRecords request for the session has
been successfully responded to, and one called whenever the push session has ended.
-
Constructor Summary
ConstructorsConstructorDescriptionPushSession(int leaderEpoch, long replicaEpoch, long replicationSessionId, org.apache.kafka.common.Node replicaNode) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanmatchesRequestData(long requestReplicaEpoch, org.apache.kafka.common.message.AppendRecordsRequestData.PartitionData data) abstract booleanonAppendRecordsResponse(long logEndOffset, long logStartOffset) Called on a successful AppendRecords response for that partition replica.abstract voidCalled when the push session has ended.longorg.apache.kafka.common.NodelongtoString()abstract voidTry to complete any pending requests in purgatory.
-
Constructor Details
-
PushSession
public PushSession(int leaderEpoch, long replicaEpoch, long replicationSessionId, org.apache.kafka.common.Node replicaNode)
-
-
Method Details
-
onAppendRecordsResponse
public abstract boolean onAppendRecordsResponse(long logEndOffset, long logStartOffset) Called on a successful AppendRecords response for that partition replica. Includes the LEO and the optional LSO for the updated partition data on the follower side.- Returns:
- whether the high watermark or low watermark increased
-
onPushSessionEnded
public abstract void onPushSessionEnded()Called when the push session has ended.
This can happen due to either:
- a leader-side event that ends the session, regardless of whether it requires notifying the follower or not - even if a "session ended" signal will be sent, the internal processing on the leader will be eagerly triggered;
- AppendRecords response processing that detects a follower-side non-retriable error that ends the session e.g. detecting a stale leader or replica epoch;
-
tryCompleteDelayedRequests
public abstract void tryCompleteDelayedRequests()Try to complete any pending requests in purgatory. Must be invoked after theonAppendRecordsResponse(long, long)handler indicates that the high watermark or low watermark increased. This is decoupled fromonAppendRecordsResponseto not have potentially expensive purgatory completions block the pusher thread or replica state updates, while also allowing the pusher thread to schedule purgatory completions on a separate worker pool. -
leaderEpoch
public int leaderEpoch() -
replicaEpoch
public long replicaEpoch() -
replicationSessionId
public long replicationSessionId() -
replicaNode
public org.apache.kafka.common.Node replicaNode() -
matchesRequestData
public boolean matchesRequestData(long requestReplicaEpoch, org.apache.kafka.common.message.AppendRecordsRequestData.PartitionData data) -
toString
-