watermark

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 5 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 watermark encodes a part's per-series durability watermark sidecar: the newest timestamp each series has in that part.

Both engines write it beside the part at flush and merge, and a replica refresh reads it instead of decoding the part's whole timestamp column. It is the same shape in both — the record engine's streams are signal.SeriesID too — so the codec lives here rather than twice.

Index

Constants

This section is empty.

Variables

View Source
var ErrCorrupt = errors.New("watermark: corrupt sidecar")

ErrCorrupt marks an unreadable sidecar. A reader treats it like an absent one and falls back to decoding the timestamp column.

Functions

func Encode

func Encode(dst []byte, entries []Entry) []byte

Encode serializes the entries in the caller's order: [magic][uvarint n] then per entry [u64 id.Hi][u64 id.Lo][i64 max], all big-endian, with a trailing CRC32C. Encode appends, and the checksum covers only the bytes it appended — whatever dst already held is not part of the record.

func Key

func Key(prefix string) string

Key is the backend key of a part's watermark sidecar (deleted with the part, since a part is removed by listing its prefix).

Types

type Entry

type Entry struct {
	ID  signal.SeriesID
	Max int64
}

Entry is one series' newest timestamp in a part.

func Decode

func Decode(data []byte) ([]Entry, error)

Decode parses a sidecar. It bounds-checks every field and never panics, returning ErrCorrupt on any malformed input so the caller can fall back to decoding.

Jump to

Keyboard shortcuts

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