struct ChangeLogIteratorInner<NI: HummockIterator<Direction = Forward>, OI: HummockIterator<Direction = Forward>> {
new_value_iter: NI,
old_value_iter: OI,
max_epoch: u64,
min_epoch: u64,
key_range: UserKeyRange,
curr_key: FullKey<Vec<u8>>,
new_value: Vec<u8>,
is_new_value_delete: bool,
is_old_value_set: bool,
is_current_pos_valid: bool,
}
Fields§
§new_value_iter: NI
Iterator for new value. In each next
, the iterator will iterate over all value of the current key.
Therefore, we need to buffer the key and newest value in curr_key
and new_value
.
We assume that all operation between min_epoch
and max_epoch
will be included in the new_value_iter
.
old_value_iter: OI
Iterator for old value. When is_old_value_set
is true, its value is the old value in the change log value.
We assume that each old value will have a new value of the same epoch in the new_value_iter
. This is to say,
For a specific key, we won’t have an epoch that only exists in the old_value_iter
but not exists in new_value_iter
.
Delete
also contains a tombstone value.
max_epoch: u64
Inclusive max epoch
min_epoch: u64
Inclusive min epoch
key_range: UserKeyRange
§curr_key: FullKey<Vec<u8>>
Buffer of current key
new_value: Vec<u8>
Buffer for new value. Only valid when is_new_value_delete
is true
is_new_value_delete: bool
Indicate whether the current new value is delete.
is_old_value_set: bool
Whether Indicate whether the current old_value_iter
represents the old value in ChangeLogValue
is_current_pos_valid: bool
Whether the iterator is currently pointing at a valid key with ChangeLogValue
Implementations§
source§impl<NI: HummockIterator<Direction = Forward>, OI: HummockIterator<Direction = Forward>> ChangeLogIteratorInner<NI, OI>
impl<NI: HummockIterator<Direction = Forward>, OI: HummockIterator<Direction = Forward>> ChangeLogIteratorInner<NI, OI>
fn new( (min_epoch, max_epoch): (u64, u64), key_range: UserKeyRange, new_value_iter: NI, old_value_iter: OI, ) -> Self
sourcepub async fn rewind(&mut self) -> HummockResult<()>
pub async fn rewind(&mut self) -> HummockResult<()>
Resets the iterating position to the beginning.
pub async fn next(&mut self) -> HummockResult<()>
pub fn is_valid(&self) -> bool
pub fn log_value(&self) -> ChangeLogValue<&[u8]>
pub fn key(&self) -> UserKey<&[u8]>
source§impl<NI: HummockIterator<Direction = Forward>, OI: HummockIterator<Direction = Forward>> ChangeLogIteratorInner<NI, OI>
impl<NI: HummockIterator<Direction = Forward>, OI: HummockIterator<Direction = Forward>> ChangeLogIteratorInner<NI, OI>
async fn try_advance_to_next_change_log_value(&mut self) -> HummockResult<()>
fn user_key_out_of_range(&self, user_key: UserKey<&[u8]>) -> bool
sourceasync fn advance_to_valid_key(&mut self) -> HummockResult<()>
async fn advance_to_valid_key(&mut self) -> HummockResult<()>
Advance the new_value_iter
to a valid key and valid epoch.
sourceasync fn advance_to_find_oldest_epoch(&mut self) -> HummockResult<EpochWithGap>
async fn advance_to_find_oldest_epoch(&mut self) -> HummockResult<EpochWithGap>
Advance the new_value_iter
to find the oldest epoch of the current key.
sourceasync fn try_advance_to_next_valid(&mut self) -> HummockResult<()>
async fn try_advance_to_next_valid(&mut self) -> HummockResult<()>
Advance the two iters to a valid position. After it returns with Ok, it is possible that the position is valid but there is no change log value, because the new and old value may consume each other, such as Insert in old epoch, but then Delete in new epoch
fn is_valid_epoch(&self, epoch: EpochWithGap) -> bool
fn old_value(&self) -> Option<&[u8]>
fn has_log_value(&self) -> bool
Auto Trait Implementations§
impl<NI, OI> !Freeze for ChangeLogIteratorInner<NI, OI>
impl<NI, OI> RefUnwindSafe for ChangeLogIteratorInner<NI, OI>where
NI: RefUnwindSafe,
OI: RefUnwindSafe,
impl<NI, OI> Send for ChangeLogIteratorInner<NI, OI>
impl<NI, OI> Sync for ChangeLogIteratorInner<NI, OI>
impl<NI, OI> Unpin for ChangeLogIteratorInner<NI, OI>
impl<NI, OI> UnwindSafe for ChangeLogIteratorInner<NI, OI>where
NI: UnwindSafe,
OI: UnwindSafe,
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
§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.