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

Method append_record

nodedb/src/wal/manager/append.rs:10–29  ·  view source on GitHub ↗

Internal: append a record of the given type to the WAL.

(
        &self,
        record_type: RecordType,
        tenant_id: TenantId,
        vshard_id: VShardId,
        database_id: DatabaseId,
        payload: &[u8],
    )

Source from the content-addressed store, hash-verified

8impl WalManager {
9 /// Internal: append a record of the given type to the WAL.
10 fn append_record(
11 &self,
12 record_type: RecordType,
13 tenant_id: TenantId,
14 vshard_id: VShardId,
15 database_id: DatabaseId,
16 payload: &[u8],
17 ) -> crate::Result<Lsn> {
18 let mut wal = self.wal.lock().unwrap_or_else(|p| p.into_inner());
19 let lsn = wal
20 .append(
21 record_type as u32,
22 tenant_id.as_u64(),
23 vshard_id.as_u32(),
24 database_id.as_u64(),
25 payload,
26 )
27 .map_err(crate::Error::Wal)?;
28 Ok(Lsn::new(lsn))
29 }
30
31 pub fn append_put(
32 &self,

Callers 15

append_putMethod · 0.80
append_deleteMethod · 0.80
append_vector_putMethod · 0.80
append_vector_deleteMethod · 0.80
append_vector_paramsMethod · 0.80
append_transactionMethod · 0.80
append_crdt_deltaMethod · 0.80
append_checkpointMethod · 0.80
append_log_batchMethod · 0.80
append_array_putMethod · 0.80
append_array_deleteMethod · 0.80

Calls 4

lockMethod · 0.80
appendMethod · 0.45
as_u64Method · 0.45
as_u32Method · 0.45

Tested by

no test coverage detected