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],
)
| 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. |
no test coverage detected