compactor

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: AGPL-3.0 Imports: 19 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 {
	Strategy
}

func (*Config) RegisterFlagsWithPrefix

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

type Strategy

type Strategy struct {
	MaxBlocksPerLevel []uint
	MaxBatchAge       int64
	MaxLevel          uint

	CleanupBatchSize int32
	CleanupDelay     time.Duration

	MaxBlocksDefault   uint
	CleanupJobMinLevel int32
	CleanupJobMaxLevel int32
}

func DefaultStrategy

func DefaultStrategy() Strategy

func (*Strategy) RegisterFlags

func (s *Strategy) RegisterFlags(prefix string, f *flag.FlagSet)

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