LZ4。
“
模式
| value | name | description |
|---|---|---|
0x02 | None | 不压缩,仅使用校验和 |
0x82 | LZ4 | 速度极快,压缩效果较好 |
0x90 | ZSTD | Zstandard,速度相当快,压缩效果最佳 |
| name | ratio | encoding | decoding |
|---|---|---|---|
| zstd 1.4.5 -1 | 2.8 | 500 MB/s | 1660 MB/s |
| lz4 1.9.2 | 2.1 | 740 MB/s | 4530 MB/s |
块
| 字段 | 类型 | 描述 |
|---|---|---|
| checksum | uint128 | (头部 + 压缩数据) 的 哈希值 |
| raw_size | uint32 | 不含头部的原始大小 |
| data_size | uint32 | 未压缩数据大小 |
| mode | byte | 压缩模式 |
| compressed_data | binary | 压缩数据块 |
hash(header + compressed_data),使用 ClickHouse CityHash。
None 模式
compressed_data 与原始数据相同。
由于哈希计算的开销可以忽略不计,无压缩模式也有助于借助校验和进一步确保数据完整性。