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

Method resolve_event_payload

nodedb/src/data/executor/core_loop/event_emit.rs:14–29  ·  view source on GitHub ↗

Convert stored bytes to msgpack for Event Plane consumption. For strict collections, the stored format is Binary Tuple which the Event Plane cannot decode (it lacks the schema). This method converts Binary Tuple → msgpack so triggers can deserialize the payload. Returns `None` for schemaless collections (already msgpack).

(
        &self,
        tid: u64,
        collection: &str,
        stored_bytes: &[u8],
    )

Source from the content-addressed store, hash-verified

12 /// Binary Tuple → msgpack so triggers can deserialize the payload.
13 /// Returns `None` for schemaless collections (already msgpack).
14 pub(in crate::data::executor) fn resolve_event_payload(
15 &self,
16 tid: u64,
17 collection: &str,
18 stored_bytes: &[u8],
19 ) -> Option<Vec<u8>> {
20 let config_key = (crate::types::TenantId::new(tid), collection.to_string());
21 let config = self.doc_configs.get(&config_key)?;
22 if let nodedb_physical::physical_plan::StorageMode::Strict { ref schema } =
23 config.storage_mode
24 {
25 crate::data::executor::strict_format::binary_tuple_to_msgpack(stored_bytes, schema)
26 } else {
27 None
28 }
29 }
30
31 /// Emit a point write/overwrite/update event derived from the new bytes
32 /// produced by the handler and the prior bytes returned from storage.

Callers 2

execute_point_deleteMethod · 0.80
emit_put_eventMethod · 0.80

Calls 3

binary_tuple_to_msgpackFunction · 0.85
to_stringMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected