Struct ppom::mdb::OMap [−][src]
pub struct OMap<K, V> { /* fields omitted */ }
Expand description
Partially persistent ordered-map type using left-leaning-red-black tree.
OMap type allow concurrent read and write access at API level, while behind the scenes, all write-operations are serialized into single thread, but the key difference is that OMap map allow concurrent-reads without using locks. To serialize concurrent writes OMap uses a spin-lock implementation.
Implementations
Set key
, value
into index. If an older entry exist with same key,
it shall be overwritten.
Set key
, value
into index. If already an entry in present with
key
, cas
should match entry’s sequence-number. If index don’t
have an entry with key
, cas
must be ZERO.
Remove the entry, matching the key, from the index.
Get entry from index for key
. An entry is returned as (value, seqno). If
key is not found return Error::KeyNotFound
Iterate over entries within the specifed range
.
Reverse iterate over entries withing specified range
. While
range
method iterate entries from start_bound to end_bound
reverse
method iterate entries from end_bound to start_bound.
Validate OMap tree with following rules:
- Root node is always black in color.
- Verify the sort order between a node and its left/right child.
- No node has RIGHT RED child and LEFT BLACK child (or NULL child).
- Make sure there are no consecutive reds.
- Make sure number of blacks are same on both left and right arm.
- Make sure that the maximum depth do not exceed MAX_TREE_DEPTH.
Trait Implementations
Auto Trait Implementations
impl<K, V> RefUnwindSafe for OMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> UnwindSafe for OMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more