Skip to main content

Module segment

Module segment 

Source
Expand description

Unified Segment System

Implements the Growing → Sealed segment lifecycle pattern. Segments are the fundamental unit of storage that handle entities of all types.

§Write Path

  1. WAL write (durability)
  2. Growing-segment entity storage in RAM (HashMap mode or flat-vector mode with epoch-published lock-free reads)
  3. seal() freezes the growing segment into a Sealed segment and builds pruning summaries over the immutable data

§Read Path

  1. Growing segment entity storage (most recent writes)
  2. Sealed segments (older, immutable, zone-map guarded)

§Lifecycle

Growing (in-memory, accepts writes)
   ↓ seal() when full or manually triggered
Sealed (immutable, zone maps built)
   ↓ flush() for persistence
Flushed (on disk, can be mmap'd)
   ↓ archive() for cold storage
Archived (compressed, infrequently accessed)

Structs§

ColZone
Tracks the min and max observed Value for one column in a segment. Used to skip segments that cannot satisfy a range or equality predicate.
GraphIndexCursor
One indexed key at a time, with an exclusive resume ID and a source-wide upper bound captured before any batch. MVCC is checked during live hydration.
GrowingSegment
Growing segment implementation (in-memory, writable)
MultiColZone
SegmentConfig
Configuration for segments
SegmentScanCursor
Stable append-only positions, bounded when a scan opens the segment.
SegmentStats
Segment statistics

Enums§

GraphEntityKind
The two physical kinds used by graph materialization passes.
SegmentError
Segment error types
SegmentState
Segment state in its lifecycle
ZoneColPred
A predicate on a single column that can be checked against a ColZone.
ZoneColPredKind
Tag-only variant of ZoneColPred — used where the Value is stored separately.

Constants§

CHECKPOINT_MUTATIONS_MAX
Maximum distinct dirty physical IDs tracked per segment and checkpoint projection.
SCAN_BATCH_SIZE
Maximum physical positions examined under one segment read guard.

Traits§

UnifiedSegment
A unified segment that stores all entity types

Type Aliases§

SegmentId
Unique identifier for a segment