pub enum ScanSinceEvent {
Insert {
key: Slice,
value: Slice,
seqno: SeqNo,
},
MergeOperand {
key: Slice,
operand: Slice,
seqno: SeqNo,
},
PointTombstone {
key: Slice,
seqno: SeqNo,
},
RangeTombstone {
start_key: Slice,
end_key: Slice,
seqno: SeqNo,
},
}Expand description
A single change event emitted by Tree::scan_since_seqno.
Each event carries the sequence number at which the change was committed. Events are emitted in increasing seqno order, so a downstream consumer (replica, Kafka connector, Debezium-style pipeline) can replay them in order to reconstruct the source’s history. Superseded versions are not collapsed: a key updated three times after the target seqno yields three events, mirroring the source’s full change history rather than just its latest visible state.
§Replay semantics
Applying events in seqno order reconstructs the state delta. An
Insert(K, V1, s=150) followed by a PointTombstone(K, s=200) means “K was
inserted with V1 at 150, then deleted at 200” — the net effect on a replica
starting before 150 is “create K with V1, then delete K”, matching the
source.
§Merge operands
A store using a MergeOperator records partial
updates as MergeOperand events rather than resolved
values: the consumer applies the same merge operator to reproduce the
source’s state. Emitting a merge as an Insert would make a replica
overwrite instead of merge, diverging from the source; resolving the merge
chain here would require reading the full base+operand history and defeat
the block-skip optimization, so the raw operand is surfaced instead.
§KV-separated (blob) values
When a value is stored out-of-line in a blob file, the blob is resolved and
the real value is carried in the Insert event, so the
consumer never needs access to the source’s blob files to replicate.
Variants§
Insert
A record was written (or overwritten) at seqno.
Covers both inline values and values resolved from a blob file.
Fields
MergeOperand
A merge operand was written at seqno.
The consumer must apply the source’s MergeOperator
to combine this operand with the prior value / operands, exactly as the
source does.
Fields
PointTombstone
A single key was deleted at seqno.
Covers both regular and weak (single-delete) tombstones; both reduce to
“this key is gone as of seqno” for replay purposes.
Fields
RangeTombstone
A half-open key range [start_key, end_key) was deleted at seqno.
Implementations§
Source§impl ScanSinceEvent
impl ScanSinceEvent
Sourcepub fn seqno(&self) -> SeqNo
pub fn seqno(&self) -> SeqNo
Sequence number at which this change was committed.
Events from Tree::scan_since_seqno
arrive in increasing order of this value.
Trait Implementations§
Source§impl Clone for ScanSinceEvent
impl Clone for ScanSinceEvent
Source§fn clone(&self) -> ScanSinceEvent
fn clone(&self) -> ScanSinceEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScanSinceEvent
impl Debug for ScanSinceEvent
impl Eq for ScanSinceEvent
Source§impl PartialEq for ScanSinceEvent
impl PartialEq for ScanSinceEvent
Source§fn eq(&self, other: &ScanSinceEvent) -> bool
fn eq(&self, other: &ScanSinceEvent) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ScanSinceEvent
Auto Trait Implementations§
impl !Freeze for ScanSinceEvent
impl RefUnwindSafe for ScanSinceEvent
impl Send for ScanSinceEvent
impl Sync for ScanSinceEvent
impl Unpin for ScanSinceEvent
impl UnsafeUnpin for ScanSinceEvent
impl UnwindSafe for ScanSinceEvent
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<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<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 more