VariantMetadata

The string dictionary half of a Variant: every field name used by the values that reference it.

The specification keeps metadata separate from values precisely so it can be shared, and rabosh takes that as far as it goes — one dictionary per SSTable, held in the segment footer, with stored documents carrying value bytes only. For the repetitive JSON that real systems produce this is the largest single space saving in the design, and it turns path resolution into one lookup per segment per query rather than a string comparison per document.

The reader is zero-copy. It holds a MemorySegment — a heap array during ingest, a mapped file region once segments are on disk — and computes offsets into it. Nothing is decoded until a name is actually asked for, and Variant field lookup never asks, because it compares UTF-8 bytes in place.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Total encoded length in bytes.

Link copied to clipboard
val size: Int

Number of strings in the dictionary.

Link copied to clipboard

Whether the dictionary is known to be sorted and free of duplicates.

Functions

Link copied to clipboard
fun indexOf(name: String): Int

Dictionary id for name, or -1 when the dictionary does not hold it.

Link copied to clipboard
fun name(id: Int): String

Field name for dictionary id.

Link copied to clipboard

The encoded metadata bytes, copied out of the underlying segment.

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