pub struct Compactor<B> { /* private fields */ }Implementations§
Source§impl<B> Compactor<B>
impl<B> Compactor<B>
pub fn new(backend: Arc<B>, compactor_path: &Path) -> Result<Self, Error>
pub async fn monitor(&mut self, namespace: &NamespaceName) -> Result<(), Error>where
B: Backend,
pub fn analyze( &self, namespace: &NamespaceName, ) -> Result<AnalyzedSegments, Error>
pub fn get_segment_range( &self, namespace: &NamespaceName, ) -> Result<Option<(SegmentInfo, SegmentInfo)>, Error>
Sourcepub async fn sync_all(&mut self, full: bool) -> Result<(), Error>where
B: Backend,
pub async fn sync_all(&mut self, full: bool) -> Result<(), Error>where
B: Backend,
sync all segments from storage with local cache
pub async fn sync_one(
&mut self,
namespace: &NamespaceName,
full: bool,
) -> Result<(), Error>where
B: Backend,
pub async fn compact(&self, set: SegmentSet) -> Result<(), Error>where
B: Backend,
Sourcepub async fn restore(
&self,
set: SegmentSet,
to: impl AsRef<Path>,
) -> Result<(), Error>where
B: Backend,
pub async fn restore(
&self,
set: SegmentSet,
to: impl AsRef<Path>,
) -> Result<(), Error>where
B: Backend,
Restore a datatase file from a segment set set must start at frame_no 1
pub fn list_all_segments( &self, namespace: &NamespaceName, f: impl FnMut(SegmentInfo), ) -> Result<(), Error>
pub fn list_monitored_namespaces( &self, f: impl FnMut(NamespaceName), ) -> Result<(), Error>
pub fn unmonitor(&self, ns: &NamespaceName) -> Result<(), Error>
Auto Trait Implementations§
impl<B> !Freeze for Compactor<B>
impl<B> !RefUnwindSafe for Compactor<B>
impl<B> Send for Compactor<B>
impl<B> !Sync for Compactor<B>
impl<B> Unpin for Compactor<B>
impl<B> !UnwindSafe for Compactor<B>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.