Skip to main content

nodedb_columnar/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Columnar segment format and memtable for NodeDB analytical storage.
4//!
5//! Provides the shared segment format used by all columnar profiles
6//! (plain, timeseries, spatial). Segments are self-contained files with
7//! per-column compressed blocks, block statistics, and a CRC-validated footer.
8//!
9//! # Segment Layout
10//!
11//! ```text
12//! [SegmentHeader: magic "NDBS" + version + endianness]
13//! [Column 0 blocks][Column 1 blocks]...[Column N blocks]
14//! [SegmentFooter: schema_hash, column metadata, block stats, CRC32C]
15//! ```
16
17pub(crate) mod diag;
18pub(crate) mod encrypt;
19
20pub mod compaction;
21pub mod delete_bitmap;
22pub mod error;
23pub mod filter;
24pub mod format;
25pub mod materialize_rows;
26pub mod memtable;
27pub mod mutation;
28pub mod pk_index;
29pub mod predicate;
30pub mod reader;
31#[cfg(test)]
32mod test_support;
33pub mod wal_record;
34pub mod writer;
35
36pub use compaction::{CompactionResult, DEFAULT_DELETE_RATIO_THRESHOLD, compact_segment};
37pub use delete_bitmap::DeleteBitmap;
38pub use error::ColumnarError;
39pub use filter::{
40    bitmask_all, bitmask_and, decoded_dict_eval_contains, decoded_dict_eval_eq,
41    decoded_dict_eval_like, decoded_dict_eval_ne, dict_eval_contains, dict_eval_eq, dict_eval_like,
42    dict_eval_ne, words_for,
43};
44pub use format::{
45    BLOCK_SIZE, BlockLayout, BlockStats, BloomFilter, ColumnMeta, MAGIC, SegmentFooter,
46    SegmentHeader, VERSION_MAJOR, VERSION_MINOR,
47};
48pub use materialize_rows::materialize_segment_live_rows;
49pub use memtable::{ColumnarMemtable, IngestValue, MemtableRowIter};
50pub use mutation::{
51    BatchConflict, BatchRow, ColumnDataSnapshot, ColumnarEngineSnapshot, MutationEngine,
52    TruncatedRows,
53};
54pub use pk_index::PkIndex;
55pub use predicate::{
56    BLOOM_BITS_DEFAULT, BLOOM_BYTES, BLOOM_K_DEFAULT, PredicateOp, PredicateValue, ScanPredicate,
57    bloom_insert, bloom_may_contain, build_bloom, build_bloom_with_params,
58};
59pub use reader::OwnedSegmentReader;
60pub use reader::SegmentReader;
61pub use writer::SegmentWriter;