SegmentSketch

Everything one segment's documents said about their shape.

Immutable, and the unit the whole catalog is built out of: one of these per live segment, folded with merge to produce the model of the store. Because the fold is over live segments, a compaction that rewrites two segments into one replaces two sketches with one automatically — there is no separate invalidation step and nothing to go stale.

The path budget is enforced here, and the overflow is reported rather than hidden. Beyond CatalogOptions.maxPaths distinct paths, the rest are folded into estimatedDroppedPaths and droppedObservations. Machine-generated field names — an object keyed by user id, a log line carrying a request id in the key — would otherwise make the path space a copy of the data.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Documents observed. Tombstones are not documents and are not counted.

Link copied to clipboard

Observations that belonged to a path beyond the budget.

Link copied to clipboard

Estimated distinct paths that did not fit the budget. Zero when nothing was dropped.

Link copied to clipboard

Total path observations, dropped ones included. Conserved by merge.

Link copied to clipboard

How many paths are tracked, dropped ones excluded.

Link copied to clipboard

The paths this sketch tracks, in canonical order.

Functions

Link copied to clipboard

Every tracked path and its sketch, in canonical order.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun get(path: CatalogPath): PathSketch?

What was observed at path, or null if it was never seen or was dropped.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun merge(other: SegmentSketch, maxPaths: Int = DEFAULT_MAX_PATHS): SegmentSketch

This sketch folded with other, keeping at most maxPaths paths.

Link copied to clipboard
open override fun toString(): String