pub struct ObjectUsage {
pub segid: SegmentId,
pub bytes: u64,
pub live_data_blocks: usize,
pub live_meta_blocks: usize,
pub live_bytes: u64,
}Expand description
How much of one stored object is still pointed into.
Fields§
§segid: SegmentIdThe object, <cno> or <cno>.<part>.
bytes: u64Its size on storage.
live_data_blocks: usizeLive data blocks in it.
live_meta_blocks: usizeLive metadata nodes in it.
live_bytes: u64What those occupy, by the container’s own block sizes.
Implementations§
Source§impl ObjectUsage
impl ObjectUsage
Sourcepub fn is_dead(&self) -> bool
pub fn is_dead(&self) -> bool
Nothing points into it: prune can take it, compaction has no work here.
Sourcepub fn live_ratio(&self) -> f64
pub fn live_ratio(&self) -> f64
Live bytes over stored bytes. Zero for a dead object, and the cost side
of the trade: rewriting this much frees Self::bytes.
Sourcepub fn holds_metadata(&self) -> bool
pub fn holds_metadata(&self) -> bool
Whether a live metadata node is in it.
Such an object cannot be freed by rewriting data blocks: a node is relocated when the flush rewrites it, which happens because something under it was dirtied, and which node covers which keys is not visible from outside the map. Compaction skips these rather than rewriting their data blocks for nothing.
Trait Implementations§
Source§impl Clone for ObjectUsage
impl Clone for ObjectUsage
Source§impl Debug for ObjectUsage
impl Debug for ObjectUsage
impl Eq for ObjectUsage
Source§impl PartialEq for ObjectUsage
impl PartialEq for ObjectUsage
impl StructuralPartialEq for ObjectUsage
Auto Trait Implementations§
impl Freeze for ObjectUsage
impl RefUnwindSafe for ObjectUsage
impl Send for ObjectUsage
impl Sync for ObjectUsage
impl Unpin for ObjectUsage
impl UnsafeUnpin for ObjectUsage
impl UnwindSafe for ObjectUsage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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.