mirror of https://github.com/apache/kafka.git
Create the image/ module for storing, reading, and writing broker metadata images. Metadata images are immutable. New images are produced from existing images using delta classes. Delta classes are mutable, and represent changes to a base image. MetadataImage objects can be converted to lists of KRaft metadata records. This is essentially writing a KRaft snapshot. The resulting snapshot can be read back into a MetadataDelta object. In practice, we will typically read the snapshot, and then read a few more records to get fully up to date. After that, the MetadataDelta can be converted to a MetadataImage as usual. Sometimes, we have to load a snapshot even though we already have an existing non-empty MetadataImage. We would do this if the broker fell too far behind and needed to receive a snapshot to catch up. This is handled just like the normal snapshot loading process. Anything that is not in the snapshot will be marked as deleted in the MetadataDelta once finishSnapshot() is called. In addition to being used for reading and writing snapshots, MetadataImage also serves as a cache for broker information in memory. A follow-up PR will replace MetadataCache, CachedConfigRepository, and the client quotas cache with the corresponding Image classes. TopicsDelta also replaces the "deferred partition" state that the RaftReplicaManager currently implements. (That change is also in a follow-up PR.) Reviewers: Jason Gustafson <jason@confluent.io>, David Arthur <mumrah@gmail.com> |
||
|---|---|---|
| .. | ||
| .scalafmt.conf | ||
| checkstyle.xml | ||
| import-control-core.xml | ||
| import-control-jmh-benchmarks.xml | ||
| import-control.xml | ||
| java.header | ||
| suppressions.xml | ||