Skip to main content

Crate varpulis_sase

Crate varpulis_sase 

Source
Expand description

SASE+ Pattern Matching Engine

Implementation of the SASE+ algorithm for Complex Event Processing. Based on the paper: “High-Performance Complex Event Processing over Streams” by Wu, Diao, Rizvi (SIGMOD 2006)

Key features:

  • NFA-based pattern matching with stack for Kleene closure
  • Efficient event selection strategies (skip-till-any-match, skip-till-next-match)
  • Negation support with temporal windows
  • Partition-by attribute optimization (SASEXT extension)

Pattern syntax supported:

  • SEQ(A, B, C): Sequence of events
  • AND(A, B): Both events in any order
  • OR(A, B): Either event
  • NOT(A): Negation (absence of event)
  • A+: Kleene plus (one or more)
  • A*: Kleene star (zero or more)
  • WITHIN(pattern, duration): Temporal constraint

Re-exports§

pub use clock::Timestamp;

Modules§

clock
Portable clock abstraction that works in both native and WASM environments.

Structs§

AndBranch
Configuration for an AND branch
AndConfig
Configuration for AND states in the NFA
AndState
Runtime state tracking for AND pattern completion
EventTimeConfig
Configuration for event-time processing
EventTimeManager
Manages event-time processing with watermarks and late event handling
EventTypeIndex
Index mapping event types to states that expect them
GlobalNegation
SASE+ Pattern Matching Engine Global negation condition for invalidating active runs
KleeneCapture
Compact representation of Kleene captures using Zero-suppressed Decision Diagrams.
LatencyHistogram
Latency histogram with exponential buckets Buckets: <1µs, <10µs, <100µs, <1ms, <10ms, <100ms, <1s, >1s
MatchResult
Result of pattern matching
MetricsSummary
Summary snapshot of SASE+ engine metrics for easier access.
NegationConstraint
Constraint for temporal negation that must be confirmed via timeout
NegationInfo
Information about what to forbid in negation states
Nfa
Non-deterministic finite automaton for SASE+ pattern matching.
NfaCompiler
Compiles a SasePattern into an NFA
PatternBuilder
Builder for SASE patterns
ProcessResult
Result of processing an event, including matches, warnings, and stats
ProcessStats
Statistics for a single process() call
Run
An active pattern run (partial match in progress)
RunSnapshot
Snapshot of an active SASE run for forecast computation.
SaseEngine
The SASE+ pattern matching engine.
SaseExtendedStats
Extended statistics with backpressure metrics
SaseMetrics
Comprehensive metrics for the SASE+ engine
SaseStats
Engine statistics snapshot.
SequenceContext
Context for evaluating sequence expressions within SASE predicates.
StackEntry
A stack entry for Kleene closure handling
State
A single state in the SASE+ NFA.

Enums§

BackpressureError
Error returned when backpressure prevents run creation
BackpressureStrategy
Strategy when the maximum number of runs is reached
CompareOp
Comparison operators for predicate evaluation.
EventTimeResult
Result of event-time processing for an event
Predicate
Predicate for event filtering
PredicateClass
Classification of a predicate relative to a Kleene closure variable.
ProcessWarning
Warning generated during event processing
SasePattern
A SASE+ pattern expression
SelectionStrategy
Event selection strategy
StateType
NFA state types
TimeSemantics
Time semantics for the engine

Constants§

MAX_ENUMERATION_RESULTS
Safety cap on results emitted by enumerate_with_filter. Prevents unbounded memory growth when the deferred predicate passes most combinations of a large Kleene closure.
MAX_KLEENE_EVENTS
Safety cap on events accumulated in a single Kleene closure. With n events the ZDD enumerates up to 2^n - 1 combinations. 20 events → ~1 M combinations (safe); 30 → ~1 B (OOM risk).

Traits§

ExprEvaluator
Trait for evaluating custom expressions in SASE predicates.

Functions§

classify_predicate
Classify a predicate as consistent or inconsistent for a Kleene state.

Type Aliases§

SharedEvent
Shared event reference for efficient cloning in pattern matching. Using Arc allows multiple pattern runs to share the same event data without expensive deep copies.