Documentation
¶
Index ¶
- type CompactionInfo
- type Manifest
- func (m *Manifest) AddSegment(info SegmentInfo) error
- func (m *Manifest) AddSegments(infos []SegmentInfo) error
- func (m *Manifest) GetActiveSegments() []SegmentInfo
- func (m *Manifest) GetCurrentVersion() uint64
- func (m *Manifest) GetSegmentsByLevel(level int) []SegmentInfo
- func (m *Manifest) GetStats() ManifestStats
- func (m *Manifest) RecordCompaction(info CompactionInfo) error
- func (m *Manifest) RemoveSegments(segmentIDs []uint64) error
- type ManifestStats
- type SegmentInfo
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompactionInfo ¶
type CompactionInfo struct { ID uint64 `json:"id"` Level int `json:"level"` Inputs []uint64 `json:"inputs"` Outputs []uint64 `json:"outputs"` StartTime int64 `json:"startTime"` EndTime int64 `json:"endTime"` Reason string `json:"reason"` }
CompactionInfo describes a compaction operation.
type Manifest ¶
type Manifest struct {
// contains filtered or unexported fields
}
Manifest manages the list of segments and provides atomic updates.
func OpenReadOnly ¶ added in v1.1.1
OpenReadOnly opens an existing manifest without creating any files or directories. It returns an error if the manifest directory or files are missing, and never writes.
func (*Manifest) AddSegment ¶
func (m *Manifest) AddSegment(info SegmentInfo) error
AddSegment adds a new segment to the manifest.
func (*Manifest) AddSegments ¶ added in v1.1.5
func (m *Manifest) AddSegments(infos []SegmentInfo) error
AddSegments adds multiple segments to the manifest atomically. Either all segments are added successfully or none are added.
func (*Manifest) GetActiveSegments ¶
func (m *Manifest) GetActiveSegments() []SegmentInfo
GetActiveSegments returns the list of active (non-deleted) segments.
func (*Manifest) GetCurrentVersion ¶
GetCurrentVersion returns the current manifest version.
func (*Manifest) GetSegmentsByLevel ¶
func (m *Manifest) GetSegmentsByLevel(level int) []SegmentInfo
GetSegmentsByLevel returns segments at a specific level.
func (*Manifest) GetStats ¶
func (m *Manifest) GetStats() ManifestStats
GetStats returns manifest statistics.
func (*Manifest) RecordCompaction ¶
func (m *Manifest) RecordCompaction(info CompactionInfo) error
RecordCompaction records a compaction operation.
func (*Manifest) RemoveSegments ¶
RemoveSegments marks segments for deletion.
type ManifestStats ¶
type ManifestStats struct { Version uint64 TotalSegments int ActiveSegments int TotalSize int64 TotalKeys uint64 LevelCounts map[int]int }
ManifestStats contains manifest statistics.
type SegmentInfo ¶
type SegmentInfo struct { ID uint64 `json:"id"` Level int `json:"level"` MinKeyHex string `json:"minKeyHex,omitempty"` MaxKeyHex string `json:"maxKeyHex,omitempty"` Size int64 `json:"size"` NumKeys uint64 `json:"numKeys"` Created int64 `json:"created"` Deleted int64 `json:"deleted,omitempty"` // Timestamp when marked for deletion }
SegmentInfo describes a segment in the manifest.
type Version ¶
type Version struct { VersionID uint64 `json:"versionID"` CreatedAt int64 `json:"createdAt"` Segments []SegmentInfo `json:"segments"` Compactions []CompactionInfo `json:"compactions,omitempty"` }
Version represents a manifest version.