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

Method put_cell

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

Insert a cell at `(coord, system_from_ms)`. The `system_from_ms` participates in the tile key so two writes at different system-time stamps produce two separate tile entries.

(&mut self, schema: &ArraySchema, args: PutCell)

Source from the content-addressed store, hash-verified

202 /// participates in the tile key so two writes at different
203 /// system-time stamps produce two separate tile entries.
204 pub fn put_cell(&mut self, schema: &ArraySchema, args: PutCell) -> ArrayResult<TileId> {
205 let PutCell {
206 coord,
207 attrs,
208 surrogate,
209 system_from_ms,
210 valid_from_ms,
211 valid_until_ms,
212 lsn,
213 } = args;
214 let tile = tile_id_for_cell(schema, &coord, system_from_ms)?;
215 let payload = CellPayload {
216 valid_from_ms,
217 valid_until_ms,
218 attrs,
219 surrogate,
220 };
221 let bytes = payload.encode()?;
222 self.tiles
223 .entry(tile)
224 .or_default()
225 .push_raw(&coord, bytes, lsn)?;
226 Ok(tile)
227 }
228
229 /// Append a tombstone version for `(coord, system_from_ms)`. Creates a
230 /// new tile-version entry in the memtable; does NOT mutate any earlier

Calls 4

tile_id_for_cellFunction · 0.85
push_rawMethod · 0.80
entryMethod · 0.80
encodeMethod · 0.45