Documentation
¶
Index ¶
- type CompactionPlan
- type Compactor
- func (c *Compactor) Execute(plan *CompactionPlan) ([]*segment.Reader, error)
- func (c *Compactor) Plan() *CompactionPlan
- func (c *Compactor) SetBuilderConfigurator(fn func(*segment.Builder))
- func (c *Compactor) Start(ctx context.Context)
- func (c *Compactor) Stop()
- func (c *Compactor) TriggerCompaction()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompactionPlan ¶ added in v1.1.0
type CompactionPlan struct {
IsTrivialMove bool // True if we can just move a single L0 file to L1
Level int // Level to compact from
TargetLevel int // Level to compact to
Inputs []manifest.SegmentInfo // Segments to compact
Overlaps []manifest.SegmentInfo // Overlapping segments in target level
Reason string
}
CompactionPlan describes a compaction task.
type Compactor ¶
type Compactor struct {
// contains filtered or unexported fields
}
Compactor manages LSM compaction.
func NewCompactor ¶
func NewCompactor(dir string, m *manifest.Manifest, logger common.Logger, alloc func() uint64) *Compactor
NewCompactor creates a new compactor.
func (*Compactor) Execute ¶ added in v1.1.0
func (c *Compactor) Execute(plan *CompactionPlan) ([]*segment.Reader, error)
Execute runs a compaction job described by the plan. It returns the list of new segment readers and an error if any.
func (*Compactor) Plan ¶ added in v1.1.0
func (c *Compactor) Plan() *CompactionPlan
Plan decides if a compaction is needed and returns a plan. If no compaction is needed, it returns nil.
func (*Compactor) SetBuilderConfigurator ¶ added in v1.1.0
SetBuilderConfigurator sets a callback that configures each new segment.Builder the compactor creates.
func (*Compactor) TriggerCompaction ¶
func (c *Compactor) TriggerCompaction()
TriggerCompaction manually triggers compaction.
Click to show internal directories.
Click to hide internal directories.