Expand description
Compaction Module for Object Storage
This module provides segment management and compaction for object storage backends. It helps maintain storage efficiency by:
- Organizing vectors into segments for batch I/O
- Merging small segments into larger ones
- Garbage collecting deleted vectors
- Running background compaction based on configurable thresholds
§Architecture
┌─────────────────────────────────────────────────────┐
│ CompactionManager │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Segment 1 │ │ Segment 2 │ │ Segment N │ │
│ │ (1000 vec) │ │ (500 vec) │ │ (750 vec) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ Compaction Job │
│ │ │
│ ▼ │
│ ┌─────────────────────┐ │
│ │ Merged Segment │ │
│ │ (2250 vec) │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────────────────┘Structs§
- Compaction
Config - Configuration for compaction operations
- Compaction
Job - Compaction job status
- Compaction
Manager - Global compaction manager for all namespaces
- Compaction
Result - Result of a compaction operation
- Compaction
Stats - Statistics for compaction operations (atomic)
- Global
Compaction Stats - Global compaction statistics
- Namespace
Segment Manager - Manages segments for a namespace
- Segment
- A segment containing vectors
- Segment
Metadata - Metadata for a segment
- Segment
Stats - Statistics for a namespace’s segments
Enums§
- Compaction
JobState - State of a compaction job
- Segment
State - Segment state
Type Aliases§
- Segment
Id - Unique identifier for a segment