pub struct SstableMeta {
pub block_metas: Vec<BlockMeta>,
pub bloom_filter: Vec<u8>,
pub estimated_size: u32,
pub key_count: u32,
pub smallest_key: Vec<u8>,
pub largest_key: Vec<u8>,
pub meta_offset: u64,
pub monotonic_tombstone_events: Vec<MonotonicDeleteEvent>,
pub version: u32,
}
Fields§
§block_metas: Vec<BlockMeta>
§bloom_filter: Vec<u8>
§estimated_size: u32
§key_count: u32
§smallest_key: Vec<u8>
§largest_key: Vec<u8>
§meta_offset: u64
§monotonic_tombstone_events: Vec<MonotonicDeleteEvent>
Assume that watermark1 is 5, watermark2 is 7, watermark3 is 11, delete ranges
{ [0, wmk1) in epoch1, [wmk1, wmk2) in epoch2, [wmk2, wmk3) in epoch3 }
can be transformed into events below:
{ <0, +epoch1> <wmk1, -epoch1> <wmk1, +epoch2> <wmk2, -epoch2> <wmk2, +epoch3> <wmk3, -epoch3> }
Then we can get monotonic events (they are in order by user key) as below:
{ <0, epoch1>, <wmk1, epoch2>, <wmk2, epoch3>, <wmk3, +inf> }
which means that delete range of [0, wmk1) is epoch1, delete range of [wmk1, wmk2) if
epoch2, etc. In this example, at the event key wmk1 (5), delete range changes from
epoch1 to epoch2, thus the new epoch
is epoch2. epoch2 will be used from the event
key wmk1 (5) and till the next event key wmk2 (7) (not inclusive).
If there is no range deletes between current event key and next event key, new_epoch
will
be HummockEpoch::MAX
.
version: u32
Format version, for further compatibility.
Implementations§
source§impl SstableMeta
impl SstableMeta
sourcepub fn encode_to_bytes(&self) -> Vec<u8> ⓘ
pub fn encode_to_bytes(&self) -> Vec<u8> ⓘ
Format:
| N (4B) |
| block meta 0 | ... | block meta N-1 |
| bloom filter len (4B) | bloom filter |
| estimated size (4B) | key count (4B) |
| smallest key len (4B) | smallest key |
| largest key len (4B) | largest key |
| K (4B) |
| tombstone-event 0 | ... | tombstone-event K-1 |
| file offset of this meta block (8B) |
| checksum (8B) | version (4B) | magic (4B) |
pub fn encode_to(&self, buf: impl BufMut + AsRef<[u8]>)
pub fn decode(buf: &[u8]) -> HummockResult<Self>
pub fn encoded_size(&self) -> usize
Trait Implementations§
source§impl Clone for SstableMeta
impl Clone for SstableMeta
source§fn clone(&self) -> SstableMeta
fn clone(&self) -> SstableMeta
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SstableMeta
impl Debug for SstableMeta
source§impl Default for SstableMeta
impl Default for SstableMeta
source§fn default() -> SstableMeta
fn default() -> SstableMeta
source§impl<'de> Deserialize<'de> for SstableMeta
impl<'de> Deserialize<'de> for SstableMeta
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for SstableMeta
impl PartialEq for SstableMeta
source§impl Serialize for SstableMeta
impl Serialize for SstableMeta
impl Eq for SstableMeta
impl StructuralPartialEq for SstableMeta
Auto Trait Implementations§
impl Freeze for SstableMeta
impl RefUnwindSafe for SstableMeta
impl Send for SstableMeta
impl Sync for SstableMeta
impl Unpin for SstableMeta
impl UnwindSafe for SstableMeta
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
source§impl<M> MetricVecRelabelExt for M
impl<M> MetricVecRelabelExt for M
source§fn relabel(
self,
metric_level: MetricLevel,
relabel_threshold: MetricLevel,
) -> RelabeledMetricVec<M>
fn relabel( self, metric_level: MetricLevel, relabel_threshold: MetricLevel, ) -> RelabeledMetricVec<M>
RelabeledMetricVec::with_metric_level
.source§fn relabel_n(
self,
metric_level: MetricLevel,
relabel_threshold: MetricLevel,
relabel_num: usize,
) -> RelabeledMetricVec<M>
fn relabel_n( self, metric_level: MetricLevel, relabel_threshold: MetricLevel, relabel_num: usize, ) -> RelabeledMetricVec<M>
RelabeledMetricVec::with_metric_level_relabel_n
.source§fn relabel_debug_1(
self,
relabel_threshold: MetricLevel,
) -> RelabeledMetricVec<M>
fn relabel_debug_1( self, relabel_threshold: MetricLevel, ) -> RelabeledMetricVec<M>
RelabeledMetricVec::with_metric_level_relabel_n
with metric_level
set to
MetricLevel::Debug
and relabel_num
set to 1.