Conventions
Every structure described in this wiki follows the same small set of rules. This page lists them once so the structure pages can stay short. LUMA (formerly strata) writes all of the structures below into a store directory.
The rules
Section titled “The rules”| Item | Rule |
|---|---|
| Integers | Little-endian unless stated. Keys are the one big-endian place, because they must sort bytewise. |
varint |
Unsigned LEB128, see varint. |
zvarint |
Zig-zag then varint, see zvarint. |
bytes |
varint len ‖ len bytes, unless a table says u32 len. |
‖ |
Concatenation. |
| Sizes | KiB = 1024 bytes. |
count(limit) |
A varint that must be at most limit, see count(limit). |
| Error classes | Corrupt and NewerFormat, see Error classes. |
| Length math | Every decoder uses checked arithmetic. Overflow is Corrupt, never a panic (SPEC V59). |
Notation in tables
Section titled “Notation in tables”Byte tables use | Offset | Size | Type | Meaning | when fields sit at fixed offsets and | Field | Encoding | Meaning | when they do not. Types such as u32 LE mean an unsigned 32-bit integer in little-endian order.
Code paths such as crates/strata-lsm/src/varint.rs are given as they are at the spec commit. The crates are being renamed to luma-*; the file structure inside them is unchanged. A statement that the code alone defines a behaviour is shown as an implementation-defined callout, and all of them are listed on Open questions.
Related
Section titled “Related”- varint, zvarint, count(limit) and Error classes
- Store layout, the first structure that uses these rules
- How to read this wiki