compaction

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultETCDQuota is the default etcd quota.
	DefaultETCDQuota = 8 * 1024 * 1024 * 1024 // 8Gi
)

Variables

This section is empty.

Functions

func InitFromFlags

func InitFromFlags(fs *flag.FlagSet, cfg *Config)

InitFromFlags initializes the compaction controller config from the provided CLI flag set.

Types

type Config

type Config struct {
	// EnableBackupCompaction specifies whether backup compaction should be enabled.
	EnableBackupCompaction bool
	// Workers denotes the number of worker threads for the compaction controller.
	Workers int
	// EventsThreshold denotes total number of etcd events to be reached upon which a backup compaction job is triggered.
	EventsThreshold int64
	// ActiveDeadlineDuration is the duration after which a running compaction job will be killed.
	ActiveDeadlineDuration time.Duration
	// MetricsScrapeWaitDuration is the duration to wait for after compaction job is completed, to allow Prometheus metrics to be scraped
	MetricsScrapeWaitDuration time.Duration
	// FeatureGates contains the feature gates to be used by Compaction Controller.
	FeatureGates map[featuregate.Feature]bool
}

Config contains configuration for the Compaction Controller.

func (*Config) CaptureFeatureActivations added in v0.19.0

func (cfg *Config) CaptureFeatureActivations(fg featuregate.FeatureGate)

CaptureFeatureActivations captures all feature gates required by the controller into controller config

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the config.

type Reconciler

type Reconciler struct {
	client.Client
	// contains filtered or unexported fields
}

Reconciler reconciles compaction jobs for Etcd resources.

func NewReconciler

func NewReconciler(mgr manager.Manager, config *Config) (*Reconciler, error)

NewReconciler creates a new reconciler for Compaction

func NewReconcilerWithImageVector

func NewReconcilerWithImageVector(mgr manager.Manager, config *Config, imageVector imagevector.ImageVector) *Reconciler

NewReconcilerWithImageVector creates a new reconciler for Compaction with an ImageVector. This constructor will mostly be used by tests.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile reconciles the compaction job.

func (*Reconciler) RegisterWithManager

func (r *Reconciler) RegisterWithManager(mgr ctrl.Manager) error

RegisterWithManager registers the Compaction Controller with the given controller manager.

Jump to

Keyboard shortcuts

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