Skip to content

Latest commit

 

History

History
147 lines (98 loc) · 3.82 KB

kafka-cluster-Replica.adoc

File metadata and controls

147 lines (98 loc) · 3.82 KB

Replica

Replica (aka partition replica) is…​FIXME

Replica is a local partition replica when the replica ID is the local broker ID.

Replica is a future local replica when the replica ID is -3.

Replica is created exclusively when Partition is requested to getOrCreateReplica.

Replica is local when the Log was defined (at the time the replica was created).

Tip

Enable INFO or TRACE logging level for kafka.cluster.Replica logger to see what happens inside.

Add the following line to config/tools-log4j.properties:

log4j.logger.kafka.cluster.Replica=TRACE

Refer to Logging.

latestEpoch Method

latestEpoch: Option[Int]

latestEpoch…​FIXME

Note
latestEpoch is used when…​FIXME

logEndOffset Method

logEndOffset: Long

logEndOffset requests the current LogOffsetMetadata for the message offset.

Note

logEndOffset is used when:

lastCaughtUpTimeMs Method

lastCaughtUpTimeMs: Long

lastCaughtUpTimeMs…​FIXME

Note
lastCaughtUpTimeMs is used when…​FIXME

logEndOffsetMetadata Method

logEndOffsetMetadata: LogOffsetMetadata

logEndOffsetMetadata…​FIXME

Note
logEndOffsetMetadata is used when…​FIXME

resetLastCaughtUpTime Method

resetLastCaughtUpTime(
  curLeaderLogEndOffset: Long,
  curTimeMs: Long,
  lastCaughtUpTimeMs: Long): Unit

resetLastCaughtUpTime…​FIXME

Note
resetLastCaughtUpTime is used when…​FIXME

Creating Replica Instance

Replica takes the following to be created:

  • Broker ID

  • TopicPartition

  • Time (default: SYSTEM)

  • initialHighWatermarkValue (default: 0L)

  • Optional Log (default: None)

Replica initializes the internal registries and counters.

While being created, Replica prints out the following INFO message to the logs and requests the Log to onHighWatermarkIncremented with the given initialHighWatermarkValue.

Replica loaded for partition [topicPartition] with initial high watermark [initialHighWatermarkValue]

convertHWToLocalOffsetMetadata Method

convertHWToLocalOffsetMetadata(): Unit

convertHWToLocalOffsetMetadata…​FIXME

Note
convertHWToLocalOffsetMetadata is used when…​FIXME

updateFetchState Method

updateFetchState(
  followerFetchOffsetMetadata: LogOffsetMetadata,
  followerStartOffset: Long,
  followerFetchTimeMs: Long,
  leaderEndOffset: Long,
  lastSentHighwatermark: Long): Unit

updateFetchState…​FIXME

Note
updateFetchState is used when…​FIXME

highWatermark_= Method

highWatermark_=(): Unit

highWatermark_=…​FIXME

Note
highWatermark_= is used when…​FIXME