Documentation ¶
Index ¶
- Constants
- func SaveCheckpointMetadata(ctx context.Context, s storage.ExternalStorage, meta *CheckpointMetadata) error
- func WalkCheckpointFile(ctx context.Context, s storage.ExternalStorage, cipher *backuppb.CipherInfo, ...) (time.Duration, error)
- type CheckpointData
- type CheckpointLock
- type CheckpointMessage
- type CheckpointMetadata
- type CheckpointRunner
- type ChecksumInfo
- type ChecksumItem
- type ChecksumItems
- type ChecksumRunner
- type GlobalTimer
- type RangeGroupData
- type RangeGroups
Constants ¶
View Source
const ( CheckpointMetaPath = "checkpoint.meta" CheckpointDir = "/checkpoints" CheckpointDataDir = CheckpointDir + "/data" CheckpointChecksumDir = CheckpointDir + "/checksum" CheckpointLockPath = CheckpointDir + "/checkpoint.lock" )
View Source
const MaxChecksumTotalCost float64 = 60.0
Variables ¶
This section is empty.
Functions ¶
func SaveCheckpointMetadata ¶
func SaveCheckpointMetadata(ctx context.Context, s storage.ExternalStorage, meta *CheckpointMetadata) error
save the checkpoint metadata into the external storage
func WalkCheckpointFile ¶
func WalkCheckpointFile(ctx context.Context, s storage.ExternalStorage, cipher *backuppb.CipherInfo, fn func(groupKey string, rg *rtree.Range)) (time.Duration, error)
walk the whole checkpoint range files and retrieve the metadatat of backed up ranges and return the total time cost in the past executions
Types ¶
type CheckpointData ¶
type CheckpointData struct { DureTime time.Duration `json:"dure-time"` RangeGroupMetas []*RangeGroupData `json:"range-group-metas"` }
type CheckpointLock ¶
type CheckpointMessage ¶
type CheckpointMetadata ¶
type CheckpointMetadata struct { GCServiceId string `json:"gc-service-id"` ConfigHash []byte `json:"config-hash"` BackupTS uint64 `json:"backup-ts"` Ranges []rtree.Range `json:"ranges"` CheckpointChecksum map[int64]*ChecksumItem `json:"-"` CheckpointDataMap map[string]rtree.RangeTree `json:"-"` }
func LoadCheckpointMetadata ¶
func LoadCheckpointMetadata(ctx context.Context, s storage.ExternalStorage) (*CheckpointMetadata, error)
load checkpoint metadata from the external storage
type CheckpointRunner ¶
type CheckpointRunner struct {
// contains filtered or unexported fields
}
func StartCheckpointRunner ¶
func StartCheckpointRunner(ctx context.Context, storage storage.ExternalStorage, cipher *backuppb.CipherInfo, timer GlobalTimer) (*CheckpointRunner, error)
func StartCheckpointRunnerForTest ¶
func StartCheckpointRunnerForTest(ctx context.Context, storage storage.ExternalStorage, cipher *backuppb.CipherInfo, tick time.Duration, timer GlobalTimer) (*CheckpointRunner, error)
only for test
func (*CheckpointRunner) FlushChecksum ¶
func (*CheckpointRunner) WaitForFinish ¶
func (r *CheckpointRunner) WaitForFinish(ctx context.Context)
Note: Cannot be parallel with `Append` function
type ChecksumInfo ¶
type ChecksumItem ¶
type ChecksumItems ¶
type ChecksumItems struct {
Items []*ChecksumItem `json:"checksum-items"`
}
type ChecksumRunner ¶
func NewChecksumRunner ¶
func NewChecksumRunner() *ChecksumRunner
func (*ChecksumRunner) FlushChecksum ¶
func (cr *ChecksumRunner) FlushChecksum( ctx context.Context, s storage.ExternalStorage, tableID int64, crc64xor uint64, totalKvs uint64, totalBytes uint64, timeCost float64, ) error
FlushChecksum save the checksum in the memory temporarily and flush to the external storage if checksum take much time
func (*ChecksumRunner) RecordError ¶
func (cr *ChecksumRunner) RecordError(err error)
type RangeGroupData ¶
type RangeGroups ¶
Click to show internal directories.
Click to hide internal directories.