checkpoint

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckpointOffsetSuffix  = "_offset"
	CheckpointRunIdSuffix   = "_runid"
	CheckpointVersionSuffix = "_version"
	CheckpointMtimeSuffix   = "_mtime"
)

Variables

This section is empty.

Functions

func DelCheckpoint

func DelCheckpoint(cli client.Redis, checkpointName string, runId string) error

clear checkpoint of dbs

func DelCheckpointHash

func DelCheckpointHash(cli client.Redis, runId string) error

func DelStaleCheckpoint

func DelStaleCheckpoint(cli client.Redis, checkpointName string, runId string, beforeNow time.Duration, exceptNewest bool) (int, int, error)

func GetAllCheckpointHash

func GetAllCheckpointHash(cli client.Redis) ([]string, error)

func GetCheckpointHash

func GetCheckpointHash(cli client.Redis, runIds []string) (cpName string, runId string, err error)

returns checkpoint name, run id, error

func SetCheckpoint

func SetCheckpoint(cli client.Redis, cp *CheckpointInfo) error

func SetCheckpointHash

func SetCheckpointHash(cli client.Redis, runId string, cpName string) error

func UpdateCheckpoint

func UpdateCheckpoint(outCli client.Redis, localCheckpoint string, ids []string) error

UpdateCheckpoint update checkpoint name as localCheckpoint (checkpoint name changes with redis typology) update checkpoint run id as first element of ids @TODO update and create timestamp for GC it is not transactional

Types

type CheckpointInfo

type CheckpointInfo struct {
	Key     string
	RunId   string
	Version string
	Offset  int64
	Mtime   int64
}

func GetCheckpoint

func GetCheckpoint(cli client.Redis, checkpointName string, runIds []string) (*CheckpointInfo, int, error)

func (*CheckpointInfo) KeyValus

func (cp *CheckpointInfo) KeyValus() []string

func (*CheckpointInfo) MTimeKey

func (cp *CheckpointInfo) MTimeKey() string

func (*CheckpointInfo) OffsetKey

func (cp *CheckpointInfo) OffsetKey() string

func (*CheckpointInfo) RunIdKey

func (cp *CheckpointInfo) RunIdKey() string

func (*CheckpointInfo) VersionKey

func (cp *CheckpointInfo) VersionKey() string

Jump to

Keyboard shortcuts

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