checkpoint

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

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