MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / materialise

Method materialise

nodedb/src/engine/array/memtable/tile_buffer.rs:135–170  ·  view source on GitHub ↗

Replay buffered entries into a fresh `SparseTile`. Live entries produce [`RowKind::Live`] rows with full payload. Sentinel entries (tombstone / GDPR erasure) are persisted as [`RowKind::Tombstone`] / [`RowKind::GdprErased`] rows so they survive the flush → segment round-trip. Compaction's retention policy is the only path permitted to drop them.

(&self, schema: &ArraySchema)

Source from the content-addressed store, hash-verified

133 /// survive the flush → segment round-trip. Compaction's retention
134 /// policy is the only path permitted to drop them.
135 pub fn materialise(&self, schema: &ArraySchema) -> ArrayResult<SparseTile> {
136 let mut b = SparseTileBuilder::new(schema);
137 for (coord_key, bytes) in &self.entries {
138 let coord = Self::decode_coord(coord_key)?;
139 if is_cell_tombstone(bytes) {
140 b.push_row(SparseRow {
141 coord: &coord,
142 attrs: &[],
143 surrogate: Surrogate::ZERO,
144 valid_from_ms: 0,
145 valid_until_ms: OPEN_UPPER,
146 kind: RowKind::Tombstone,
147 })?;
148 } else if is_cell_gdpr_erasure(bytes) {
149 b.push_row(SparseRow {
150 coord: &coord,
151 attrs: &[],
152 surrogate: Surrogate::ZERO,
153 valid_from_ms: 0,
154 valid_until_ms: OPEN_UPPER,
155 kind: RowKind::GdprErased,
156 })?;
157 } else {
158 let payload = CellPayload::decode(bytes)?;
159 b.push_row(SparseRow {
160 coord: &coord,
161 attrs: &payload.attrs,
162 surrogate: payload.surrogate,
163 valid_from_ms: payload.valid_from_ms,
164 valid_until_ms: payload.valid_until_ms,
165 kind: RowKind::Live,
166 })?;
167 }
168 }
169 Ok(b.build())
170 }
171}
172
173#[derive(Debug, Default)]

Calls 5

is_cell_tombstoneFunction · 0.85
is_cell_gdpr_erasureFunction · 0.85
push_rowMethod · 0.80
decodeFunction · 0.50
buildMethod · 0.45