MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / increment

Method increment

src/sql-server-util/src/cdc.rs:558–569  ·  view source on GitHub ↗

Increment this [`Lsn`]. The returned [`Lsn`] may not exist upstream yet, but it's guaranteed to sort greater than `self`.

(self)

Source from the content-addressed store, hash-verified

556 /// The returned [`Lsn`] may not exist upstream yet, but it's guaranteed to
557 /// sort greater than `self`.
558 pub fn increment(self) -> Lsn {
559 let (record_id, carry) = self.record_id.overflowing_add(1);
560 let (block_id, carry) = self.block_id.overflowing_add(carry.into());
561 let (vlf_id, overflow) = self.vlf_id.overflowing_add(carry.into());
562 assert!(!overflow, "overflowed Lsn, {self:?}");
563
564 Lsn {
565 vlf_id,
566 block_id,
567 record_id,
568 }
569 }
570
571 /// Drops the `record_id` portion of the [`Lsn`] so we can fit an "abbreviation"
572 /// of this [`Lsn`] into a [`u64`], without losing the total order.

Callers 2

test_caseFunction · 0.45
renderFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_caseFunction · 0.36