Write a segment with the given (TileId, SparseTile) pairs (must be strictly ascending by TileId) and return the in-memory bytes.
(pairs: Vec<(TileId, SparseTile)>)
| 355 | /// Write a segment with the given (TileId, SparseTile) pairs (must be |
| 356 | /// strictly ascending by TileId) and return the in-memory bytes. |
| 357 | fn build_segment(pairs: Vec<(TileId, SparseTile)>) -> Vec<u8> { |
| 358 | let mut w = SegmentWriter::new(0xBEEF); |
| 359 | for (id, tile) in pairs { |
| 360 | w.append_sparse(id, &tile).unwrap(); |
| 361 | } |
| 362 | w.finish(None).unwrap() |
| 363 | } |
| 364 | |
| 365 | /// Build a single-row Live SparseTile at coord `x` with value `v`. |
| 366 | fn live_tile(schema: &ArraySchema, x: i64, v: i64) -> SparseTile { |