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
:
FetchLogEnd
if the request comes from a followerFetchTxnCommitted
if the request comes from a consumer withREAD_COMMITTED
isolation levelFetchHighWatermark
otherwise
fetchMessages
readFromLocalLog (passing in the FetchIsolation
among the others).
fetchMessages
...FIXME
fetchMessages
is used when:
KafkaApis
is requested to handle a Fetch requestReplicaAlterLogDirsThread
is 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:
DelayedFetch
is requested toonComplete
ReplicaManager
is requested to fetchMessages
becomeLeaderOrFollower¶
becomeLeaderOrFollower(
correlationId: Int,
leaderAndIsrRequest: LeaderAndIsrRequest,
onLeadershipChange: (Iterable[Partition], Iterable[Partition]) => Unit): LeaderAndIsrResponse
becomeLeaderOrFollower
...FIXME
becomeLeaderOrFollower
is used when:
KafkaApis
is 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