compactor

package
v0.0.100-dev Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore() *store.BlockQueueStore

Types

type BlockQueueStore

type BlockQueueStore interface {
	StoreEntry(*bbolt.Tx, compaction.BlockEntry) error
	DeleteEntry(tx *bbolt.Tx, index uint64, id string) error
	ListEntries(*bbolt.Tx) iter.Iterator[compaction.BlockEntry]
	CreateBuckets(*bbolt.Tx) error
}

type Compactor

type Compactor struct {
	// contains filtered or unexported fields
}

func NewCompactor

func NewCompactor(
	config Config,
	store BlockQueueStore,
	tombstones Tombstones,
	reg prometheus.Registerer,
) *Compactor

func (*Compactor) Compact

func (c *Compactor) Compact(tx *bbolt.Tx, entry compaction.BlockEntry) error

func (*Compactor) Init

func (c *Compactor) Init(tx *bbolt.Tx) error

func (*Compactor) NewPlan

func (c *Compactor) NewPlan(cmd *raft.Log) compaction.Plan

func (*Compactor) Restore

func (c *Compactor) Restore(tx *bbolt.Tx) error

func (*Compactor) UpdatePlan

func (c *Compactor) UpdatePlan(tx *bbolt.Tx, plan *raft_log.CompactionPlanUpdate) error

type Config

type Config struct {
	Levels []LevelConfig

	CleanupBatchSize   int32
	CleanupDelay       time.Duration
	CleanupJobMinLevel int32
	CleanupJobMaxLevel int32
}

func DefaultConfig added in v1.13.3

func DefaultConfig() Config

func (*Config) RegisterFlagsWithPrefix

func (c *Config) RegisterFlagsWithPrefix(string, *flag.FlagSet)

type LevelConfig added in v1.13.3

type LevelConfig struct {
	MaxBlocks uint
	MaxAge    int64
}

type Tombstones

type Tombstones interface {
	ListTombstones(before time.Time) iter.Iterator[*metastorev1.Tombstones]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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