Module cached_replay

Module cached_replay 

Source
Expand description

Cached-replay fast path for the SSE Parquet streaming endpoint: when a request’s geometry + metadata are already cached, replay them without re-parsing, in the same Start / (Batch + Progress)* / Complete shape a live parse streams (issue #3895). The geometry is split back into its original stream batches via parquet_replay_batches::split_into_batches (recovered from the cached blob’s Parquet row-group boundaries); a blob with no recoverable boundary falls back to one oversized batch, same as before.

progress numbers come from the stream_progress sidecar the live parse wrote, so a hit reports the same JOB counts a miss does (issue #3897). Entries cached before that sidecar existed have no job counts to replay; those fall back to counting emitted MESHES, which is the wrong unit but still monotonic and still ends at its own stated total.

Functions§

cached_geometry_slice 🔒
Return the geometry slice from a cached combined-Parquet blob, framed as [geometry_len: u32-LE][geometry_data][data_model_len: u32].... Returns None (rather than panicking) when the blob is too short to hold the length header or declares a geometry length that runs past the buffer — the caller treats that as a cache miss and re-parses.
replay_by_client_hash 🔒
Serve POST /api/v1/parse/parquet-stream from a client-supplied file hash, with no request body at all (issue #3901).
try_cached_replay 🔒
Try to serve a parse_parquet_stream request from the cache. Returns Ok(Some(response)) on a usable cache hit (the caller drops its admission guard and returns the response as-is), Ok(None) on a miss or a short/corrupt cached blob (the caller falls through to the live parse, which overwrites the bad entry).