Skip to main content

Crate nodedb_codec

Crate nodedb_codec 

Source
Expand description

Compression codecs for NodeDB timeseries columnar storage.

Provides per-column codec selection with cascading compression: type-aware encoding (ALP, FastLanes, FSST, Pcodec) followed by a terminal byte compressor (lz4_flex for hot/warm, rANS for cold/S3).

Cascading chains (hot/warm — lz4 terminal):

  • AlpFastLanesLz4: f64 metrics → ALP → FastLanes → lz4
  • DeltaFastLanesLz4: i64 timestamps/counters → Delta → FastLanes → lz4
  • FastLanesLz4: i64 raw integers → FastLanes → lz4
  • FsstLz4: strings/logs → FSST → lz4
  • PcodecLz4: complex numerics → Pcodec → lz4
  • AlpRdLz4: true doubles → ALP-RD → lz4

Cold/S3 tier chains (rANS terminal):

  • AlpFastLanesRans, DeltaFastLanesRans, FsstRans

Shared by Origin and Lite. Compiles to WASM.

Re-exports§

pub use crdt_compress::CrdtOp;
pub use delta::DeltaDecoder;
pub use delta::DeltaEncoder;
pub use detect::detect_codec;
pub use double_delta::DoubleDeltaDecoder;
pub use double_delta::DoubleDeltaEncoder;
pub use error::CodecError;
pub use gorilla::GorillaDecoder;
pub use gorilla::GorillaEncoder;
pub use lz4::Lz4Decoder;
pub use lz4::Lz4Encoder;
pub use pipeline::decode_bytes_pipeline;
pub use pipeline::decode_f64_pipeline;
pub use pipeline::decode_i64_pipeline;
pub use pipeline::encode_bytes_pipeline;
pub use pipeline::encode_f64_pipeline;
pub use pipeline::encode_i64_pipeline;
pub use raw::RawDecoder;
pub use raw::RawEncoder;
pub use zstd_codec::ZstdDecoder;
pub use zstd_codec::ZstdEncoder;

Modules§

alp
ALP (Adaptive Lossless floating-Point) codec for f64 columns.
alp_rd
ALP-RD (Real Doubles) codec for true arbitrary f64 values.
crdt_compress
CRDT state compression for Loro deltas.
delta
Delta codec for monotonic counter columns.
detect
Codec auto-detection from column type and data distribution.
double_delta
DoubleDelta codec for timestamp columns.
error
Error types for codec operations.
fastlanes
FastLanes-inspired FOR + bit-packing codec for integer columns.
fsst
FSST (Fast Static Symbol Table) codec for string/log columns.
gorilla
Gorilla XOR encoding for floating-point timeseries metrics.
lz4
LZ4 block compression codec for string/log columns.
pcodec
Pcodec wrapper for complex numerical sequences.
pipeline
Cascading codec pipeline: chains type-aware encoding → terminal compressor.
rans
Interleaved rANS (Asymmetric Numeral Systems) entropy coder.
raw
Raw (identity) codec — no compression.
spherical
Spherical coordinate transform for lossless vector embedding compression.
zstd_codec
Zstd compression codec for cold/archived partitions.

Structs§

ColumnStatistics
Per-column statistics computed at flush time.

Enums§

ColumnCodec
Codec identifier for per-column compression selection.
ColumnTypeHint
Column data type hint for codec auto-detection.

Constants§

CODEC_SAMPLE_SIZE
Number of values to sample for codec auto-detection and exponent selection. Used by ALP, ALP-RD, and the codec detector.