LpNameSpillStore class
#include <gtopt/lp_name_spill.hpp>
Async, Parquet-backed store for LP col/row label metadata.
Thread-safe. spill enqueues an off-thread Parquet write and returns at once; load blocks only until the matching spill has been flushed, then caches the loaded metadata so repeated writes for the same key are free.
Constructors, destructors, conversion operators
- LpNameSpillStore(const LpNameSpillStore&) deleted
- LpNameSpillStore(LpNameSpillStore&&) deleted
- LpNameSpillStore(std::filesystem::path dir) explicit
- ~LpNameSpillStore()
Public functions
- void drain()
- auto load(const std::string& key) -> const LpLabelMeta*
- auto operator=(const LpNameSpillStore&) -> LpNameSpillStore& deleted
- auto operator=(LpNameSpillStore&&) -> LpNameSpillStore& deleted
- void spill(std::string key, LpLabelMeta meta)
Function documentation
gtopt:: LpNameSpillStore:: LpNameSpillStore(std::filesystem::path dir) explicit
Metadata Parquet files land under dir (created if missing) and the whole directory is removed on destruction.
void gtopt:: LpNameSpillStore:: drain()
Block until every queued spill has been flushed to disk (test/teardown helper).
const LpLabelMeta* gtopt:: LpNameSpillStore:: load(const std::string& key)
Load (cached) the metadata for key, blocking until any still-pending spill for key has been written. Returns nullptr if key was never spilled. The returned pointer is stable for the lifetime of the store.
void gtopt:: LpNameSpillStore:: spill(std::string key,
LpLabelMeta meta)
Enqueue an async Parquet write of meta under key. Returns immediately; the worker thread builds the Arrow table and writes the Parquet file. meta is moved into the queue, so the caller can drop its copy.