Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
We want to expose control messages through o.a.k.r.Batch and RecordsIterator. This can be done by turning the type Batch<T> into an interface and adding the type ControlBatch implements Batch<?> and DataBatch<T> implements Batch<T>. The main different between DataBatch<T> and ControlBatch is that control record have a decoder that knows how to decode LeaderChangeMessage, SnapshotHeaderRecord and SnapshotFooterRecord.
These are the import type and signatures that we expose:
- class RecordsIterator<T> implements Iterator<Batch<T>> this type will keep the current signature but it will be extended to know how to decode both Data and Control batches
- interface BatchReader<T> extends Iterator<DataBatch<T>> this type only returns data batches
- class SnapshotReader<T> implements Iterator<DataBatch<T>> this type only returns data batches but when it reads the header record it remembers the last contained log timestamp
Attachments
Issue Links
- links to