|
Relational NT
A relational database kernel shaped around NT-style object management.
|
Content-addressing utilities for tuples. More...
Go to the source code of this file.
Namespaces | |
| namespace | nt |
| Contains the Relational NT runtime managers and API facade. | |
Functions | |
| std::string | nt::TupleCodec::Hash (const std::vector< Attribute > &attrs) |
| Computes the SHA256 hex digest of the serialized tuple. | |
| std::vector< uint8_t > | nt::TupleCodec::Serialize (const std::vector< Attribute > &attrs) |
| Serializes a tuple's attributes to raw bytes for KV storage. | |
| std::vector< Attribute > | nt::TupleCodec::Deserialize (const std::vector< uint8_t > &bytes) |
| Reconstructs attributes from the bytes returned by Serialize(). | |
Content-addressing utilities for tuples.
Mirrors Sakura's hashing.ml and physical.ml:
The hash input format is: "path_seg1/path_seg2/..|name1:value1;name2:value2;" where attributes are sorted by name for determinism.
The serialization format is a sequence of length-prefixed UTF-8 pairs: [uint32_le name_len][name bytes][uint32_le value_len][value bytes] ...
| std::vector< Attribute > nt::TupleCodec::Deserialize | ( | const std::vector< uint8_t > & | bytes | ) |
Reconstructs attributes from the bytes returned by Serialize().
| bytes | Bytes produced by Serialize(). |
| std::string nt::TupleCodec::Hash | ( | const std::vector< Attribute > & | attrs | ) |
Computes the SHA256 hex digest of the serialized tuple.
Equivalent to SHA256(Serialize(attrs)), so the value returned here matches the key returned by IStorageBackend::Put(Serialize(attrs)).
| attrs | Attribute set. Need not be pre-sorted. |
| std::vector< uint8_t > nt::TupleCodec::Serialize | ( | const std::vector< Attribute > & | attrs | ) |
Serializes a tuple's attributes to raw bytes for KV storage.
| attrs | Attribute set. Need not be pre-sorted. |