Struct below_store::StoreWriter
source · [−]pub struct StoreWriter { /* private fields */ }
Expand description
The StoreWriter struct maintains state to put more data in the store. It keeps track of the index and data file it’s currently working on so in the common case it can just append data. When it rolls over to a new shard, it will recreate itself.
Implementations
Create a new StoreWriter
that writes data to path
directory. Data serialized with format
.
If compression_mode
is set, dataframes are zstd compressed,
as defined by compression_mode
.
pub fn new_with_timestamp<P: AsRef<Path>>(
logger: Logger,
path: P,
timestamp: SystemTime,
compression_mode: CompressionMode,
format: Format
) -> Result<Self>
Store data with corresponding timestamp. Returns true if a new shard is created and data is written successfully. Errors may be returned if file operations fail.
Discard all data earlier than timestamp
We do not modify index and data files. We just look for files which can only contain earlier data and remove them.
Discard data until store size is less than limit, or there is only one shard left. Oldest shards are discarded first. Returns true on success or false if the current shard size is greater than the limit.