pub fn v2_to_legacy(
batch: &RecordBatch,
target: Magic,
) -> Result<Bytes, LegacyRecordsError>Expand description
Down-convert a v2 [RecordBatch] to v0/v1 MessageSet bytes.
If the v2 batch carried gzip or snappy compression, the output uses
that codec in a wrapped MessageSet. The output keeps LZ4 in the same
way. v0/v1 cannot represent Zstd, so this function emits an
uncompressed MessageSet for a Zstd batch. The v2 decode path has
already decompressed those records.
ยงErrors
Returns an error if an absolute offset or timestamp exceeds i64, or if
this function cannot encode the legacy message set.