cockroach: Index | Files

package compactor

import ""


Package Files

compactor.go metrics.go settings.go

type Compactor Uses

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

A Compactor records suggested compactions and periodically makes requests to the engine to reclaim storage space.

func NewCompactor Uses

func NewCompactor(
    st *cluster.Settings, eng storage.Engine, capFn storeCapacityFunc, doneFn doneCompactingFunc,
) *Compactor

NewCompactor returns a compactor for the specified storage engine.

func (*Compactor) Start Uses

func (c *Compactor) Start(ctx context.Context, stopper *stop.Stopper)

Start launches a compaction processing goroutine and exits when the provided stopper indicates. Processing is done with a periodicity of compactionMinInterval, but only if there are compactions pending.

func (*Compactor) Suggest Uses

func (c *Compactor) Suggest(ctx context.Context, sc kvserverpb.SuggestedCompaction)

Suggest writes the specified compaction to persistent storage and pings the processing goroutine.

type Metrics Uses

type Metrics struct {
    BytesQueued         *metric.Gauge
    BytesSkipped        *metric.Counter
    BytesCompacted      *metric.Counter
    CompactionSuccesses *metric.Counter
    CompactionFailures  *metric.Counter
    CompactingNanos     *metric.Counter

Metrics holds all metrics relating to a Compactor.

func (Metrics) MetricStruct Uses

func (Metrics) MetricStruct()

MetricStruct implements the metrics.Struct interface.

Package compactor imports 18 packages (graph) and is imported by 2 packages. Updated 2020-08-12. Refresh now. Tools for package owners.