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
- func CountDeletemeSegments(ctx context.Context, c testcontainers.Container, col, shard, bucket string) int
- func ImportBatch(t *testing.T, className string)
- func IsStable(ctx context.Context, c testcontainers.Container, col, shard string, ...) bool
- func ListBucketFiles(ctx context.Context, c testcontainers.Container, col, shard, bucket string) []string
- func ListLSMBuckets(ctx context.Context, c testcontainers.Container, col, shard string) []string
- func MaxLevelAndCount(ctx context.Context, c testcontainers.Container, col, shard, bucket string) (maxLevel, segCount int)
- func RandomText(n int) string
- func SegmentLevel(name string) int
- func TotalSegmentFileCount(ctx context.Context, c testcontainers.Container, col, shard, bucket string) int
Constants ¶
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 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 MaxLevelAndCount ¶
func RandomText ¶
RandomText generates a string of approximately n ASCII characters composed of space-separated lowercase words, ensuring each object has unique tokens.
func SegmentLevel ¶
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.