ReplicaManager¶
fetchMessages¶
fetchMessages(
timeout: Long,
replicaId: Int,
fetchMinBytes: Int,
fetchMaxBytes: Int,
hardMaxBytesLimit: Boolean,
fetchInfos: Seq[(TopicPartition, PartitionData)],
quota: ReplicaQuota,
responseCallback: Seq[(TopicPartition, FetchPartitionData)] => Unit,
isolationLevel: IsolationLevel,
clientMetadata: Option[ClientMetadata]): Unit
fetchMessages determines whether the request comes from a follower or a consumer (based on the given replicaId).
fetchMessages determines FetchIsolation:
FetchLogEndif the request comes from a followerFetchTxnCommittedif the request comes from a consumer withREAD_COMMITTEDisolation levelFetchHighWatermarkotherwise
fetchMessages readFromLocalLog (passing in the FetchIsolation among the others).
fetchMessages...FIXME
fetchMessages is used when:
KafkaApisis requested to handle a Fetch requestReplicaAlterLogDirsThreadis requested to fetchFromLeader
readFromLocalLog¶
readFromLocalLog(
replicaId: Int,
fetchOnlyFromLeader: Boolean,
fetchIsolation: FetchIsolation,
fetchMaxBytes: Int,
hardMaxBytesLimit: Boolean,
readPartitionInfo: Seq[(TopicPartition, PartitionData)],
quota: ReplicaQuota,
clientMetadata: Option[ClientMetadata]): Seq[(TopicPartition, LogReadResult)]
readFromLocalLog...FIXME
readFromLocalLog finds the Partition and requests it to readRecords.
readFromLocalLog...FIXME
readFromLocalLog is used when:
DelayedFetchis requested toonCompleteReplicaManageris requested to fetchMessages
becomeLeaderOrFollower¶
becomeLeaderOrFollower(
correlationId: Int,
leaderAndIsrRequest: LeaderAndIsrRequest,
onLeadershipChange: (Iterable[Partition], Iterable[Partition]) => Unit): LeaderAndIsrResponse
becomeLeaderOrFollower...FIXME
becomeLeaderOrFollower is used when:
KafkaApisis requested to handleLeaderAndIsrRequest
makeLeaders¶
makeLeaders(
controllerId: Int,
controllerEpoch: Int,
partitionStates: Map[Partition, LeaderAndIsrPartitionState],
correlationId: Int,
responseMap: mutable.Map[TopicPartition, Errors],
highWatermarkCheckpoints: OffsetCheckpoints,
topicIds: String => Option[Uuid]): Set[Partition]
makeLeaders...FIXME