seriestable

package
v0.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package seriestable stores immutable identity-only runs under the engine's catalog.

Index

Constants

View Source
const IDColumn = "series"

IDColumn is the sole physical column in a metadata run.

Variables

View Source
var ErrClosed = errors.New("seriestable: closed run")

ErrClosed rejects new operations after a run is retired.

View Source
var ErrCorrupt = errors.Wrap(seriesindex.ErrCorrupt, "series table")

ErrCorrupt identifies an invalid metadata run.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder owns sorted, distinct canonical identities; it carries no sample metadata.

func NewBorrowedBuilder

func NewBorrowedBuilder(view series.View) Builder

NewBorrowedBuilder builds postings while borrowing descriptors from a pinned view.

func (*Builder) Add

func (b *Builder) Add(id signal.SeriesID, s signal.Series) error

Add copies a checked identity in strictly increasing canonical-ID order.

func (*Builder) AddBorrowed

func (b *Builder) AddBorrowed(ref int) error

AddBorrowed appends an ordered descriptor reference from the pinned view.

func (*Builder) AddView

func (b *Builder) AddView(view series.View, i int) error

AddView copies a descriptor from a validated registry in canonical-ID order.

func (*Builder) Bytes

func (b *Builder) Bytes() int64

Bytes bounds builder and ID-column construction workspace.

func (*Builder) Count

func (b *Builder) Count() int

Count returns the number of descriptors.

func (*Builder) EncodedBound

func (b *Builder) EncodedBound() int64

EncodedBound bounds buffered output before compression.

func (*Builder) StreamingDirectoryBytes

func (b *Builder) StreamingDirectoryBytes() int64

StreamingDirectoryBytes bounds the index directory when pages are streamed.

func (*Builder) WriteIndex

func (b *Builder) WriteIndex(ctx context.Context, be backend.Backend, key string) error

WriteIndex writes only an unbound index for a private postings spill.

type IDCache

type IDCache struct {
	// contains filtered or unexported fields
}

IDCache retains byte-bounded routing filters and validated ID arrays.

func NewIDCache

func NewIDCache(limit int64) *IDCache

NewIDCache creates an empty cache; a nonpositive limit disables retention.

func (*IDCache) SizeBytes

func (c *IDCache) SizeBytes() int64

SizeBytes includes filters, arrays, pending construction and cache bookkeeping.

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

Iterator yields sorted canonical IDs and borrowed descriptors until Close.

func (*Iterator) Close

func (it *Iterator) Close() error

Close releases scratch and the run pin.

func (*Iterator) Err

func (it *Iterator) Err() error

Err reports the iteration error.

func (*Iterator) ID

func (it *Iterator) ID() signal.SeriesID

ID returns the current canonical identity hash.

func (*Iterator) Next

func (it *Iterator) Next() bool

Next advances the cursor; Raw expires at every call.

func (*Iterator) Raw

func (it *Iterator) Raw() []byte

Raw returns a descriptor borrowed until the next Next or Close.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader owns bounded page scratch for one operation. It is not concurrent-safe.

func (*Reader) Close

func (r *Reader) Close() error

Close releases owned scratch and its run pin.

func (*Reader) HasID

func (r *Reader) HasID(id signal.SeriesID) (bool, error)

HasID tests exact membership without touching any descriptor record.

func (*Reader) IDs

func (r *Reader) IDs(ctx context.Context) postings.Postings

IDs returns a sorted ID cursor valid while this reader pins the immutable run.

func (*Reader) LookupOrdinal

func (r *Reader) LookupOrdinal(id signal.SeriesID, ordinal uint32) ([]byte, error)

LookupOrdinal reads a descriptor at a known position and checks its full ID.

func (*Reader) LookupRaw

func (r *Reader) LookupRaw(id signal.SeriesID) ([]byte, bool, error)

LookupRaw returns a borrowed descriptor, valid until the next lookup or Close.

func (*Reader) Resolve

func (r *Reader) Resolve(matchers []fetch.Matcher) (*Iterator, error)

Resolve creates an independently owned iterator using this operation's context.

func (*Reader) StreamPages

func (r *Reader) StreamPages()

StreamPages uses operation-local page buffers for ordered descriptor access.

type Run

type Run struct {
	// contains filtered or unexported fields
}

Run retains immutable metadata only. The engine owns catalog and object reclamation.

func Open

func Open(ctx context.Context, be backend.Backend, prefix string, expected ...[32]byte) (*Run, error)

Open validates a run and optionally checks its catalog-bound manifest digest.

func OpenWithIDCache

func OpenWithIDCache(ctx context.Context, be backend.Backend, prefix string, cache *IDCache, expected ...[32]byte) (*Run, error)

OpenWithIDCache retains validated IDs within cache's separate memory budget.

func Write

func Write(ctx context.Context, be backend.Backend, prefix string, b *Builder) (*Run, error)

Write writes and syncs an unused, caller-owned prefix; it does not publish a catalog.

func WriteContiguous

func WriteContiguous(ctx context.Context, be backend.Backend, prefix string, view series.View, refs []uint32,
	inputs []*seriesindex.Index, cache *IDCache,
) (*Run, error)

WriteContiguous writes one immutable run from bounded, private postings spills.

func WriteOrdinalMerge

func WriteOrdinalMerge(ctx context.Context, be backend.Backend, prefix string, count int,
	merge *seriesindex.PostingMerge, idAt func(int) signal.SeriesID, rawAt func(int) ([]byte, error), cache *IDCache,
) (*Run, error)

WriteOrdinalMerge writes a descriptor run from pinned source ordinals.

func WriteWithIDCache

func WriteWithIDCache(ctx context.Context, be backend.Backend, prefix string, b *Builder, cache *IDCache) (*Run, error)

WriteWithIDCache writes a run and retains its IDs within cache's memory budget.

func (*Run) Close

func (r *Run) Close() error

Close refuses new readers and retires retained handles after active operations finish.

func (*Run) Count

func (r *Run) Count() uint32

Count is descriptor cardinality, not active sample cardinality.

func (*Run) Digest

func (r *Run) Digest() [32]byte

Digest is the catalog binding for this run.

func (*Run) Iterate

func (r *Run) Iterate(ctx context.Context) (*Iterator, error)

Iterate walks every descriptor in canonical-ID order.

func (*Run) MaxCanonicalBytes

func (r *Run) MaxCanonicalBytes() int64

MaxCanonicalBytes is the maximum canonical record size.

func (*Run) MaxPageBytes

func (r *Run) MaxPageBytes() int64

MaxPageBytes bounds one index cursor's scratch.

func (*Run) NewReader

func (r *Run) NewReader(ctx context.Context) (*Reader, error)

NewReader reserves scratch and pins the run until Close.

func (*Run) PostingIndex

func (r *Run) PostingIndex() *seriesindex.Index

PostingIndex exposes the immutable index while the caller pins the run.

func (*Run) ReaderContext

func (r *Run) ReaderContext(ctx context.Context) context.Context

ReaderContext binds reads to this run's retained immutable-file generation.

func (*Run) Resolve

func (r *Run) Resolve(ctx context.Context, matchers []fetch.Matcher) (*Iterator, error)

Resolve yields canonical identities selected by typed label predicates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL