Skip to main content

Module txn

Module txn 

Source
Expand description

Atomic database writes backed by one RocksDB write batch.

A transaction queues operations for maps owned by one database engine and commits them only when Txn::execute consumes it. Typed operations use the database codec, while raw operations preserve caller-provided bytes.

Structsยง

Keys ๐Ÿ”’
Record parser yielding each queued key with its resolved map.
Txn
Atomic write batch spanning one or more column families from one database.

Enumsยง

Tag ๐Ÿ”’
Record tags per rocksdb write_batch.cc; puts and deletes against column family id 0 encode as the legacy untagged types.

Constantsยง

HEADER ๐Ÿ”’
Batch representation header: a fixed64 sequence then a fixed32 count.
PER_OP ๐Ÿ”’
Worst-case per-record overhead: a type tag and three varint32s.

Functionsยง

next_record ๐Ÿ”’
Decodes one record into its column family identifier and borrowed key.
size_hint ๐Ÿ”’
Estimates write-batch capacity for a reusable sequence of raw pairs.
take_varint32 ๐Ÿ”’
Takes one RocksDB varint32 from the front of a batch record.
take_varstring ๐Ÿ”’
Takes one length-prefixed byte string from the front of a batch record.