pub struct StoreMerger<'a, W: Write> { /* private fields */ }Expand description
Store merger - concatenates compressed blocks from multiple stores without recompression
This is much faster than rebuilding stores since it avoids:
- Decompressing blocks from source stores
- Re-serializing documents
- Re-compressing blocks at level 22
Limitations:
- All source stores must NOT use dictionaries (or use the same dictionary)
- Doc IDs are remapped sequentially
Implementations§
Source§impl<'a, W: Write> StoreMerger<'a, W>
impl<'a, W: Write> StoreMerger<'a, W>
pub fn new(writer: &'a mut W) -> Self
Sourcepub async fn append_store<F: AsyncFileRead>(
&mut self,
data_slice: &F,
blocks: &[RawStoreBlock],
) -> Result<()>
pub async fn append_store<F: AsyncFileRead>( &mut self, data_slice: &F, blocks: &[RawStoreBlock], ) -> Result<()>
Append raw compressed blocks from a store file
data_slice should be the data portion of the store (before index/footer)
blocks contains the block metadata from the source store
Sourcepub async fn append_store_recompressing(
&mut self,
store: &AsyncStoreReader,
) -> Result<()>
pub async fn append_store_recompressing( &mut self, store: &AsyncStoreReader, ) -> Result<()>
Append blocks from a dict-compressed store by decompressing and recompressing.
For stores that use dictionary compression, raw blocks can’t be stacked directly because the decompressor needs the original dictionary. This method decompresses each block with the source dict, then recompresses without a dictionary so the merged output is self-contained.
Auto Trait Implementations§
impl<'a, W> Freeze for StoreMerger<'a, W>
impl<'a, W> RefUnwindSafe for StoreMerger<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for StoreMerger<'a, W>where
W: Send,
impl<'a, W> Sync for StoreMerger<'a, W>where
W: Sync,
impl<'a, W> Unpin for StoreMerger<'a, W>
impl<'a, W> !UnwindSafe for StoreMerger<'a, W>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.