retention

package
v0.53.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: 2 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 retention bounds repeated background rewrites at a moving expiry cutoff.

Index

Constants

View Source
const RewriteInterval = time.Hour

RewriteInterval is the minimum interval between forced background retention rewrites.

Variables

This section is empty.

Functions

func Due

func Due(last, now time.Time) bool

Due reports whether a partial-retention rewrite may be forced. A zero now bypasses coalescing.

Types

type Bound added in v0.52.0

type Bound uint8

Bound identifies the policy bound that sets a retention cutoff.

const (
	// BoundNone means no retention bound is set.
	BoundNone Bound = iota
	// BoundAge means the signal's age limit binds.
	BoundAge
	// BoundSignalBytes means the signal's stored-byte budget binds.
	BoundSignalBytes
	// BoundPooledBytes means the tenant's pooled stored-byte budget binds.
	BoundPooledBytes
)

func (Bound) String added in v0.52.0

func (b Bound) String() string

String returns the bound's stable display name.

type Request added in v0.52.0

type Request struct {
	Cutoff int64
	Bound  Bound
	Term   uint64
}

Request is the most recent authorized retention request for one engine tenure.

type State added in v0.52.0

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

State publishes a coherent retention request without joining merge execution.

func (*State) Load added in v0.52.0

func (s *State) Load(term uint64) Request

Load returns the request only while its ownership term is current.

func (*State) Record added in v0.52.0

func (s *State) Record(cutoff int64, bound Bound, term uint64)

Record publishes a request, including one whose physical cleanup may defer or fail.

Jump to

Keyboard shortcuts

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