(
schema: &ArraySchema,
schema_hash: u64,
kek: Option<&nodedb_wal::crypto::WalEncryptionKey>,
tiles: impl Iterator<Item = (TileId, MergedTile)>,
)
| 293 | } |
| 294 | |
| 295 | fn build_segment_bytes( |
| 296 | schema: &ArraySchema, |
| 297 | schema_hash: u64, |
| 298 | kek: Option<&nodedb_wal::crypto::WalEncryptionKey>, |
| 299 | tiles: impl Iterator<Item = (TileId, MergedTile)>, |
| 300 | ) -> ArrayResult<Vec<u8>> { |
| 301 | let mut writer = SegmentWriter::new(schema_hash); |
| 302 | for (tile_id, mt) in tiles { |
| 303 | let tile = mt.into_sparse(schema)?; |
| 304 | // Skip tiles that have neither live rows nor sentinel rows. |
| 305 | let has_any_rows = tile.nnz() > 0 || !tile.row_kinds.is_empty(); |
| 306 | if !has_any_rows { |
| 307 | continue; |
| 308 | } |
| 309 | writer.append_sparse(tile_id, &tile)?; |
| 310 | } |
| 311 | writer.finish(kek) |
| 312 | } |
| 313 | |
| 314 | /// Row record inside a [`MergedTile`] accumulator. |
| 315 | struct MergedRow { |
no test coverage detected