kafka/checkstyle
Colin Patrick McCabe b4e45cd0d2
KAFKA-13019: Add MetadataImage and MetadataDelta classes for KRaft Snapshots (#10949)
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>
2021-07-01 00:08:25 -07:00
..
.scalafmt.conf MINOR: Add Scalafmt to Streams Scala API (#4965) 2018-07-09 16:48:34 -07:00
checkstyle.xml KAFKA-12375: don't reuse thread.id until a thread has fully shut down (#10215) 2021-03-02 16:28:15 -08:00
import-control-core.xml KAFKA-12758 Added `server-common` module to have server side common classes. (#10638) 2021-05-11 09:58:28 -07:00
import-control-jmh-benchmarks.xml MINOR: Replace BrokerStates.scala with BrokerState.java (#10028) 2021-02-03 13:41:38 -08:00
import-control.xml KAFKA-13019: Add MetadataImage and MetadataDelta classes for KRaft Snapshots (#10949) 2021-07-01 00:08:25 -07:00
java.header MINOR: improve license header check by providing head file instead of (prefix) header regex 2017-02-28 12:35:04 -08:00
suppressions.xml KAFKA-13019: Add MetadataImage and MetadataDelta classes for KRaft Snapshots (#10949) 2021-07-01 00:08:25 -07:00