Skip to main content

Crate novakv

Crate novakv 

Source
Expand description

novakv — an embedded, ordered key-value store. Crate root.

The headline entry point is db_impl::DBImpl — open a DB, run put / get / delete / write / new_iterator / get_snapshot. Most callers only need prelude.

§Layout

Each public module is a focused layer of the storage engine. Every module’s //! doc explains what’s there and when to reach for it.

ModuleWhat’s in it
codingvarint + fixed-LE primitives
statusStatus, Code, Result
hashnon-cryptographic 32-bit hash
crc32cCRC32C + masked variant
comparatorComparator trait + BytewiseComparator
formatinternal-key format, level constants
write_batchWriteBatch, WriteBatchHandler
blockdata-block builder + reader
filterFilterPolicy + BloomFilterPolicy
filter_blockper-block filter index
two_level_iterindex-of-blocks iterator
merging_iterk-way merge iterator
tableSSTable builder + reader + Compressor
logWAL writer + reader
skiplistlock-free skiplist
memtablein-memory write buffer
filenameDB-directory file naming
envfilesystem trait + StdEnv + MemEnv
cacheCache trait + ShardedLRUCache
table_cacheopen-Table cache
version_setLSM level metadata + manifest
db_implDBImpl, Options, ReadOptions, WriteOptions
db_itersnapshot-aware iterator
repairreconstruct a damaged DB
destroydelete a DB directory
slice(ptr, len) byte view

§Quickstart

use novakv::prelude::*;

let env = MemEnv::new();
let db = DBImpl::open("/db", env, BytewiseComparator, Options::default()).unwrap();
db.put(b"hello", b"world").unwrap();
assert_eq!(db.get(b"hello").unwrap(), Some(b"world".to_vec()));

See db_impl for the full API surface and tuning knobs.

Re-exports§

pub use db_iter::DbIterator;
pub use comparator::BytewiseComparator;
pub use comparator::Comparator;
pub use format::InternalKey;
pub use format::InternalKeyComparator;
pub use format::LookupKey;
pub use format::ParsedInternalKey;
pub use format::SequenceNumber;
pub use format::ValueType;
pub use format::MAX_SEQUENCE_NUMBER;
pub use format::VALUE_TYPE_FOR_SEEK;
pub use status::Code;
pub use status::Result;
pub use status::Status;
pub use write_batch::WriteBatch;
pub use write_batch::WriteBatchHandler;
pub use write_batch::WriteBatchRecord;

Modules§

block
Prefix-compressed key-value block.
cache
Generic refcounted LRU cache.
coding
Fixed-width and varint primitives for on-disk byte layouts.
comparator
Total order over user keys.
crc32c
CRC32C with the Castagnoli polynomial.
db_impl
DBImpl — the database handle, plus public option structs.
db_iter
Snapshot-aware DB iterator.
destroy
Delete an entire DB directory.
env
Filesystem abstraction.
filename
DB-directory file-naming helpers.
filter
Probabilistic key-presence filter.
filter_block
Per-data-block filter index.
format
Internal-key format and LSM-level constants.
hash
Non-cryptographic 32-bit hash.
log
Write-ahead log.
memtable
In-memory write buffer.
merging_iter
K-way merge over multiple sorted iterators.
prelude
Public-API surface. An embedder typically only needs the items in this prelude — concrete types for opening / using / closing a database, plus the trait that abstracts over DBImpl.
repair
DB repair utility.
skiplist
Lock-free reads, single-writer skiplist.
slice
Lightweight (ptr, len) borrowed-bytes view.
status
Engine-wide error type.
table
On-disk SSTable: builder, reader, and the Compressor trait.
table_cache
Open-Table cache.
two_level_iter
Two-level iterator: index iterator over data-block iterators.
version_set
LSM level metadata + manifest log.
write_batch
Atomic batched writes.