Frame
Every section of a SEAM data file except the footer is a frame: data blocks, the bloom frame, the stats frame and the index frame.
Layout
Section titled “Layout”| Offset | Size | Type | Meaning |
|---|---|---|---|
| 0 | 1 | u8 | low nibble = codec id, high nibble = block format |
| 1 | 4 | u32 LE | raw_len, the decompressed length (at most 64 MiB) |
| 5 | m | bytes | body = codec(raw) |
| 5+m | 32 | bytes | seal trailer |
The first three rows are the plaintext before sealing.
Codec ids
Section titled “Codec ids”| Id | Codec |
|---|---|
| 0 | raw; m == raw_len is required |
| 1 | zstd, one standard zstd frame |
| 2 | LZ4 block format (lz4_flex::block, no frame header) |
Any other id is Corrupt. The decompressed length must equal raw_len. See zstd and LZ4 framing.
Block format nibble
Section titled “Block format nibble”For data frames only; meta frames use 0.
| Value | Format |
|---|---|
| 0 | row block |
| 1 | columnar block |
Any other value is Corrupt("block format").
Writer codec policy
Section titled “Writer codec policy”Per crates/strata-lsm/src/codec.rs:
- Compressed output is kept only if
packed + packed/8 < raw; otherwise the frame is raw. - The default data codec is zstd level 1 (
Auto). - Warm layers use LZ4.
- The cold layer uses zstd level 9 with 128 KiB blocks.
- A per-table override (catalog ext
C, see compression) selects none, LZ4 or zstd by key prefix. - Bloom frames are always raw. Stats and index frames use zstd unless compression is
None.
Each frame is authenticated under an AAD that binds the file id and its position, see AAD per object. A block moved to another offset or file is rejected.
Related
Section titled “Related”- SEAM data file
- Seal trailer
- Reader invariants
- Footer revision 3, the read-only revision that marks a file with an LZ4 frame