checkpoint

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(scheduler tasks.TaskScheduler, cfg *PolicyCfg) *ckpDriver

Types

type Driver

type Driver interface {
	// aware.ChangeAware
	// aware.DataMutationAware
	EnqueueCheckpointUnit(unit data.CheckpointUnit)
	EnqueueCheckpointEntry(wal.LogEntry)
	Start()
	Stop()
	String() string
}

type LeveledPolicy

type LeveledPolicy interface {
	TotalLevels() int
	DecideLevel(score int) int
	ScanInterval(level int) time.Duration
}
var DefaultLeveledPolicy LeveledPolicy

type LeveledUnits

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

func NewLeveledUnits

func NewLeveledUnits(scheduler tasks.TaskScheduler, policy LeveledPolicy) *LeveledUnits

func (*LeveledUnits) AddUnit

func (lunits *LeveledUnits) AddUnit(unit data.CheckpointUnit)

func (*LeveledUnits) RunCalibration

func (lunits *LeveledUnits) RunCalibration()

func (*LeveledUnits) Scan

func (lunits *LeveledUnits) Scan()

type PolicyCfg

type PolicyCfg struct {
	Interval int64 // ms
	Levels   int
}

type Units

type Units struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewUnits

func NewUnits() *Units

func (*Units) AddUnit

func (units *Units) AddUnit(u data.CheckpointUnit)

func (*Units) AddUnits

func (units *Units) AddUnits(us []data.CheckpointUnit)

func (*Units) ConsumeAll

func (units *Units) ConsumeAll() map[data.CheckpointUnit]bool

func (*Units) PrepareConsume

func (units *Units) PrepareConsume(maxDuration time.Duration) bool

func (*Units) UpdateTS

func (units *Units) UpdateTS()

Jump to

Keyboard shortcuts

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