compactions

package
v1.38.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package compactions inspects LSM segment state from outside a running Weaviate container — the only blackbox way to detect compaction activity in acceptance tests.

Index

Constants

View Source
const (
	ObjectsPerBatch = 200
	// 200 obj × 2 KB ≈ 400 KB/batch; keeps property_text growing
	TextSize = 2_000
)

Variables

This section is empty.

Functions

func CountDeletemeSegments

func CountDeletemeSegments(ctx context.Context, c testcontainers.Container, col, shard, bucket string) int

CountDeletemeSegments counts files ending in ".deleteme".

func ImportBatch

func ImportBatch(t *testing.T, className string)

func IsStable

func IsStable(ctx context.Context, c testcontainers.Container, col, shard string, buckets []string) bool

IsStable returns true when no bucket has ≥2 segments at the same level, meaning all pending compactions have completed and the LSM tree has stabilised.

func ListBucketFiles

func ListBucketFiles(ctx context.Context, c testcontainers.Container, col, shard, bucket string) []string

ListBucketFiles executes `ls -1` inside the container for the given bucket directory and returns plain filenames (basenames).

func ListLSMBuckets

func ListLSMBuckets(ctx context.Context, c testcontainers.Container, col, shard string) []string

func MaxLevelAndCount

func MaxLevelAndCount(ctx context.Context, c testcontainers.Container, col, shard, bucket string) (maxLevel, segCount int)

func RandomText

func RandomText(n int) string

RandomText generates a string of approximately n ASCII characters composed of space-separated lowercase words, ensuring each object has unique tokens.

func SegmentLevel

func SegmentLevel(name string) int

SegmentLevel parses the compaction level from a segment filename.

segment-{nanos}.db                → 0
segment-{id1}_{id2}.db            → 1
segment-{id1}_{id2}.l{N}.s{M}.db  → N

func TotalSegmentFileCount

func TotalSegmentFileCount(ctx context.Context, c testcontainers.Container, col, shard, bucket string) int

TotalSegmentFileCount counts all *.db and *.deleteme files. Monotonically increasing while a view is held (proxy for "N flushes occurred").

Types

This section is empty.

Jump to

Keyboard shortcuts

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