etcd: go.etcd.io/etcd/etcdserver/api/v3compactor Index | Files

package v3compactor

import "go.etcd.io/etcd/etcdserver/api/v3compactor"

Package v3compactor implements automated policies for compacting etcd's mvcc storage.

Index

Package Files

compactor.go doc.go periodic.go revision.go

Constants

const (
    ModePeriodic = "periodic"
    ModeRevision = "revision"
)

type Compactable Uses

type Compactable interface {
    Compact(ctx context.Context, r *pb.CompactionRequest) (*pb.CompactionResponse, error)
}

type Compactor Uses

type Compactor interface {
    // Run starts the main loop of the compactor in background.
    // Use Stop() to halt the loop and release the resource.
    Run()
    // Stop halts the main loop of the compactor.
    Stop()
    // Pause temporally suspend the compactor not to run compaction. Resume() to unpose.
    Pause()
    // Resume restarts the compactor suspended by Pause().
    Resume()
}

Compactor purges old log from the storage periodically.

func New Uses

func New(
    lg *zap.Logger,
    mode string,
    retention time.Duration,
    rg RevGetter,
    c Compactable,
) (Compactor, error)

New returns a new Compactor based on given "mode".

type Periodic Uses

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

Periodic compacts the log by purging revisions older than the configured retention time.

func (*Periodic) Pause Uses

func (pc *Periodic) Pause()

Pause pauses periodic compactor.

func (*Periodic) Resume Uses

func (pc *Periodic) Resume()

Resume resumes periodic compactor.

func (*Periodic) Run Uses

func (pc *Periodic) Run()

Run runs periodic compactor.

func (*Periodic) Stop Uses

func (pc *Periodic) Stop()

Stop stops periodic compactor.

type RevGetter Uses

type RevGetter interface {
    Rev() int64
}

type Revision Uses

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

Revision compacts the log by purging revisions older than the configured reivison number. Compaction happens every 5 minutes.

func (*Revision) Pause Uses

func (rc *Revision) Pause()

Pause pauses revision-based compactor.

func (*Revision) Resume Uses

func (rc *Revision) Resume()

Resume resumes revision-based compactor.

func (*Revision) Run Uses

func (rc *Revision) Run()

Run runs revision-based compactor.

func (*Revision) Stop Uses

func (rc *Revision) Stop()

Stop stops revision-based compactor.

Package v3compactor imports 9 packages (graph) and is imported by 17 packages. Updated 2018-08-29. Refresh now. Tools for package owners.