Documentation ¶
Overview ¶
Package compactor implements automated policies for compacting etcd's mvcc storage.
Index ¶
Constants ¶
View Source
const ( ModePeriodic = "periodic" ModeRevision = "revision" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compactable ¶
type Compactable interface {
Compact(ctx context.Context, r *pb.CompactionRequest) (*pb.CompactionResponse, error)
}
type Compactor ¶ added in v3.3.0
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.
type Periodic ¶
type Periodic struct {
// contains filtered or unexported fields
}
Periodic compacts the log by purging revisions older than the configured retention time.
func NewPeriodic ¶
func NewPeriodic(h time.Duration, rg RevGetter, c Compactable) *Periodic
NewPeriodic creates a new instance of Periodic compactor that purges the log older than h Duration.
type Revision ¶ added in v3.3.0
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 NewRevision ¶ added in v3.3.0
func NewRevision(retention int64, rg RevGetter, c Compactable) *Revision
NewRevision creates a new instance of Revisonal compactor that purges the log older than retention revisions from the current revision.
func (*Revision) Pause ¶ added in v3.3.0
func (t *Revision) Pause()
Pause pauses revision-based compactor.
Click to show internal directories.
Click to hide internal directories.