pub trait Cleaner {
// Required methods
fn collect(
&self,
low: SegmentId,
high: SegmentId,
) -> impl Future<Output = Result<(Vec<SegmentId>, Vec<SegmentId>)>> + Send;
fn prune(
&self,
low: SegmentId,
high: SegmentId,
) -> impl Future<Output = Result<()>> + Send;
}Expand description
Operations supported by a hyperfile cleaner backend.
Both methods take a [low, high] segment-id range. high == 0
is a sentinel meaning “use the latest published checkpoint
(Inode::get_last_seq)”. low is inclusive; a typical value is
1 to cover the entire file history.
Required Methods§
Sourcefn collect(
&self,
low: SegmentId,
high: SegmentId,
) -> impl Future<Output = Result<(Vec<SegmentId>, Vec<SegmentId>)>> + Send
fn collect( &self, low: SegmentId, high: SegmentId, ) -> impl Future<Output = Result<(Vec<SegmentId>, Vec<SegmentId>)>> + Send
Walk the metadata tree of the checkpoint identified by high
(or the latest if high == 0) and return
(referenced, unreferenced) segment id lists within
[low, high].
Useful for dry-run inspection before invoking Cleaner::prune.
Sourcefn prune(
&self,
low: SegmentId,
high: SegmentId,
) -> impl Future<Output = Result<()>> + Send
fn prune( &self, low: SegmentId, high: SegmentId, ) -> impl Future<Output = Result<()>> + Send
Walk the metadata tree as in Cleaner::collect and then
delete the unreferenced segment objects from the underlying
store.
Errors if any individual delete batch fails; in that case previously-deleted batches stay deleted (S3 has no transactional batch). The returned error message mentions the failed object count and a sample failed key.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".