Update spec.md

This commit is contained in:
Brandon Liu
2022-10-07 11:40:54 +08:00
committed by GitHub
parent 3d40ca4501
commit a5a9b737ae

View File

@@ -25,14 +25,15 @@ A Directory is a list of `Entries`, in ascending order by `TileId`:
# Directory Serialization # Directory Serialization
Entries are stored in memory as integers, but serialized to disk using these compression steps: Entries are stored in memory as integers, but serialized to disk using these compression steps:
1. A little-endian varint indicating the # of entries.
2. Delta encoding of `TileId` 1. A little-endian varint indicating the # of entries
3. Zeroing of `Offset`: 2. Delta encoding of `TileId`
* `0` if it is equal to the `Offset` + `Length` of the previous entry 3. Zeroing of `Offset`:
* `Offset+1` otherwise * `0` if it is equal to the `Offset` + `Length` of the previous entry
4. Varint encoding of ll numbers * `Offset+1` otherwise
5. Columnar ordering: all `TileId`s, all `RunLength`s, all `Length`s, then all `Offset`s 4. Varint encoding of all numbers
6. Finally, general purpose compression as described by the `Header`'s `InternalCompression` field. 5. Columnar ordering: all `TileId`s, all `RunLength`s, all `Length`s, then all `Offset`s
6. Finally, general purpose compression as described by the `Header`'s `InternalCompression` field
# Directory Hierarchy # Directory Hierarchy