pub struct ParquetCache { /* private fields */ }Expand description
Process-wide cache of encoded Parquet exports, keyed by dataset name.
The /datasets/{name}/parquet endpoint serves a complete Parquet file
with HTTP range support. A single client (e.g. DuckDB httpfs) issues
several requests against it — a HEAD for the length, then ranged
GETs for the footer and any row-group metadata — so every request
must observe the same bytes. Caching the encoded file makes those
requests cheap and consistent; crate::handlers::v1::reload_dataset
drops the entry after a successful reload so a fresh export is built
on next access.
Implementations§
Source§impl ParquetCache
impl ParquetCache
Sourcepub fn get(&self, name: &str) -> Option<Arc<Bytes>>
pub fn get(&self, name: &str) -> Option<Arc<Bytes>>
Return the cached export for name, if one has been built.
Sourcepub fn insert(&self, name: &str, bytes: Bytes) -> Arc<Bytes> ⓘ
pub fn insert(&self, name: &str, bytes: Bytes) -> Arc<Bytes> ⓘ
Store bytes as the export for name, returning the stored handle.
Sourcepub fn invalidate(&self, name: &str)
pub fn invalidate(&self, name: &str)
Drop the cached export for name (no-op if absent).
Trait Implementations§
Source§impl Default for ParquetCache
impl Default for ParquetCache
Source§fn default() -> ParquetCache
fn default() -> ParquetCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ParquetCache
impl RefUnwindSafe for ParquetCache
impl Send for ParquetCache
impl Sync for ParquetCache
impl Unpin for ParquetCache
impl UnsafeUnpin for ParquetCache
impl UnwindSafe for ParquetCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more