pub struct HotArchive { /* private fields */ }Expand description
Implementations§
Source§impl HotArchive
impl HotArchive
Sourcepub fn open(archive: &Path, level: i32, policy: SkipPolicy) -> Result<Self>
pub fn open(archive: &Path, level: i32, policy: SkipPolicy) -> Result<Self>
Open archive for hot appends, creating it if absent.
Three entry states, all handled here so no caller has to know which it is:
- already hot — journal segments exist; their rows are loaded and the blob cursor is taken from the last one.
- sealed — a static
.znippy; its rows are recovered into a fresh segment and the (rebuildable) metadata tail is dropped. O(rows), once. - absent — a new archive at blob offset 0.
Sourcepub fn is_hot(archive: &Path) -> bool
pub fn is_hot(archive: &Path) -> bool
Whether archive currently has a journal — i.e. is in its hot phase.
Sourcepub fn append(&mut self, files: &[(String, Vec<u8>)]) -> Result<HotAppendReport>
pub fn append(&mut self, files: &[(String, Vec<u8>)]) -> Result<HotAppendReport>
Append files, paying only for files.
Replace semantics match append_files: a
relative_path already present is superseded and its old blob bytes
become dead payload.
Sourcepub fn seal(
self,
reserved: Option<ReservedSectionBuilder>,
) -> Result<HotSealReport>
pub fn seal( self, reserved: Option<ReservedSectionBuilder>, ) -> Result<HotSealReport>
Freeze the hot archive into a static .znippy and drop the journal.
The blobs are already in place and are not touched: the seal writes the
metadata tail only. reserved is the same hook
ArrowIpcSink::with_reserved_builder
offers, so a caller with its own sections (gunnar’s __gunnar_refs__)
seals them here rather than needing a second seal.
Trait Implementations§
Source§impl ZnippyReader for HotArchive
The hot archive reads without being sealed — that is the other half of “worth
having”. Same trait the static ZnippyArchive
implements, so a caller does not branch on phase.
impl ZnippyReader for HotArchive
The hot archive reads without being sealed — that is the other half of “worth
having”. Same trait the static ZnippyArchive
implements, so a caller does not branch on phase.