Skip to main content

nodedb_array/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! NodeDB Array Engine — shared ND sparse array primitives.
4//!
5//! This crate provides the type substrate, schema definitions, coordinate
6//! encoding, and tile layout used by the array engine on both Origin
7//! (server) and Lite (embedded) deployments. Storage, WAL integration,
8//! and SQL routing live in their respective Origin-side crates.
9
10pub mod codec;
11pub mod coord;
12pub mod error;
13pub mod query;
14pub mod schema;
15pub mod segment;
16pub mod sync;
17pub mod tile;
18pub mod types;
19pub mod wal;
20
21pub use coord::{
22    bits_per_dim, decode_hilbert_prefix, decode_zorder_prefix, encode_hilbert_prefix,
23    encode_zorder_prefix, normalize_coord,
24};
25pub use error::{ArrayError, ArrayResult};
26pub use schema::{
27    ArraySchema, ArraySchemaBuilder, AttrSpec, CellOrder, DimSpec, DimType, TileOrder,
28};
29pub use segment::{
30    FOOTER_MAGIC, FORMAT_VERSION, HEADER_MAGIC, HilbertPackedRTree, MbrQueryPredicate,
31    SegmentFooter, SegmentHeader, SegmentReader, SegmentWriter, TileEntry, TileKind, TilePayload,
32};
33pub use sync::{
34    AckVector, ApplyEngine, ApplyOutcome, ApplyRejection, ArrayOp, ArrayOpHeader, ArrayOpKind,
35    CoordRange, GcReport, Hlc, HlcGenerator, OpLog, ReplicaId, SchemaDoc, SnapshotChunk,
36    SnapshotHeader, SnapshotSink, TileSnapshot,
37};
38pub use tile::{
39    AttrStats, DENSE_PROMOTION_THRESHOLD, DenseTile, SparseTile, TileMBR, should_promote_to_dense,
40    sparse_to_dense, tile_id_for_cell, tile_indices_for_cell,
41};
42pub use types::{ArrayId, CellValue, Coord, Domain, TileId};
43pub use wal::ArrayWalRecord;