Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 1.34 KB

File metadata and controls

71 lines (49 loc) · 1.34 KB

API: EHSketchList

Status: Ready

Purpose

Unified enum wrapper for sketch payloads used by EH-style frameworks.

Type/Struct

enum EHSketchList {
    CM(CountMin<Vector2D<i32>, FastPath>),
    CS(Count<Vector2D<i32>, FastPath>),
    COUNTL2HH(CountL2HH),
    HLL(HyperLogLog<ErtlMLE>),
    KLL(KLL),
    DDS(DDSketch),
    COCO(Coco),
    ELASTIC(Elastic),
    UNIFORM(UniformSampling),
    UNIVMON(UnivMon),
}

Constructors

Enum-based; construct by variant.

Insert/Update

fn insert(&mut self, val: &DataInput)

Query

fn query(&self, key: &DataInput) -> Result<f64, &'static str>
fn supports_norm(&self, norm: SketchNorm) -> bool
fn sketch_type(&self) -> &'static str

Merge

fn merge(&mut self, other: &EHSketchList) -> Result<(), &'static str>

Serialization

Serialized through serde as part of parent structures.

Examples

use asap_sketchlib::{CountMin, EHSketchList, FastPath, DataInput, Vector2D};

let mut sk = EHSketchList::CM(CountMin::<Vector2D<i32>, FastPath>::default());
sk.insert(&DataInput::U64(1));
let _ = sk.query(&DataInput::U64(1));

Caveats

  • Some variant paths still contain todo!() branches in input conversion.
  • Some merge/query variant combinations are intentionally unsupported.

Status

Core wrapper in EH and optimized window frameworks.