pub struct HummockReadVersion {
table_id: TableId,
instance_id: LocalInstanceId,
staging: StagingVersion,
committed: CommittedVersion,
is_replicated: bool,
table_watermarks: Option<TableWatermarksIndex>,
vnodes: Arc<Bitmap>,
}
Expand description
A container of information required for reading from hummock.
Fields§
§table_id: TableId
§instance_id: LocalInstanceId
§staging: StagingVersion
Local version for staging data.
committed: CommittedVersion
Remote version for committed data.
is_replicated: bool
Indicate if this is replicated. If it is, we should ignore it during
global state store read, to avoid duplicated results.
Otherwise for local state store, it is fine, see we will see the
ReadVersion
just for that local state store.
table_watermarks: Option<TableWatermarksIndex>
§vnodes: Arc<Bitmap>
Implementations§
source§impl HummockReadVersion
impl HummockReadVersion
pub fn new_with_replication_option( table_id: TableId, instance_id: LocalInstanceId, committed_version: CommittedVersion, is_replicated: bool, vnodes: Arc<Bitmap>, ) -> Self
pub fn new( table_id: TableId, instance_id: LocalInstanceId, committed_version: CommittedVersion, vnodes: Arc<Bitmap>, ) -> Self
pub fn table_id(&self) -> TableId
sourcepub fn update(&mut self, info: VersionUpdate)
pub fn update(&mut self, info: VersionUpdate)
Updates the read version with VersionUpdate
.
There will be three data types to be processed
VersionUpdate::Staging
- StagingData::ImmMem
-> Insert into memory’s staging_imm
- StagingData::Sst
-> Update the sst to memory’s staging_sst
and remove the
corresponding staging_imms
according to the batch_id
VersionUpdate::CommittedDelta
-> Unimplemented yet
VersionUpdate::CommittedSnapshot
-> Update committed_version
, and clean up related
staging_sst
and staging_imm
in memory according to epoch
pub fn staging(&self) -> &StagingVersion
pub fn committed(&self) -> &CommittedVersion
sourcepub fn filter_regress_watermarks(&self, watermarks: &mut Vec<VnodeWatermark>)
pub fn filter_regress_watermarks(&self, watermarks: &mut Vec<VnodeWatermark>)
We have assumption that the watermark is increasing monotonically. Therefore, here if the upper layer usage has passed an regressed watermark, we should filter out the regressed watermark. Currently the kv log store may write regressed watermark
pub fn latest_watermark(&self, vnode: VirtualNode) -> Option<Bytes>
pub fn is_replicated(&self) -> bool
pub fn update_vnode_bitmap(&mut self, vnodes: Arc<Bitmap>) -> Arc<Bitmap>
pub fn contains(&self, vnode: VirtualNode) -> bool
pub fn vnodes(&self) -> Arc<Bitmap>
Trait Implementations§
source§impl Clone for HummockReadVersion
impl Clone for HummockReadVersion
source§fn clone(&self) -> HummockReadVersion
fn clone(&self) -> HummockReadVersion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for HummockReadVersion
impl !RefUnwindSafe for HummockReadVersion
impl Send for HummockReadVersion
impl Sync for HummockReadVersion
impl Unpin for HummockReadVersion
impl !UnwindSafe for HummockReadVersion
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<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.