Documentation
¶
Index ¶
- func NeedsMerge(left, right *RangeStats, splitSizeBytes, splitKeyCount uint64) bool
- func ZapRanges(ranges []KeyRange) zapcore.Field
- type DeletedRange
- type KeyRange
- type ProgressRange
- type ProgressRangeTree
- func (rangeTree *ProgressRangeTree) FindContained(startKey, endKey []byte) (*ProgressRange, error)
- func (rangeTree *ProgressRangeTree) GetChecksumMap() map[int64]*metautil.ChecksumStats
- func (rangeTree *ProgressRangeTree) GetIncompleteRanges() ([]*kvrpcpb.KeyRange, error)
- func (rangeTree *ProgressRangeTree) Insert(pr *ProgressRange) error
- func (rangeTree *ProgressRangeTree) SetCallBack(callback func())
- func (rangeTree *ProgressRangeTree) UpdateChecksum(physicalID int64, crc, kvs, bytes uint64)
- type Range
- type RangeStats
- type RangeStatsTree
- type RangeTree
- func (rangeTree *RangeTree) Find(rg *Range) *Range
- func (rangeTree *RangeTree) GetIncompleteRange(startKey, endKey []byte) []*kvrpcpb.KeyRange
- func (rangeTree *RangeTree) InsertRange(rg Range) *Range
- func (rangeTree *RangeTree) Put(startKey, endKey []byte, files []*backuppb.File)
- func (rangeTree *RangeTree) PutForce(startKey, endKey []byte, files []*backuppb.File, force bool) bool
- func (rangeTree *RangeTree) Update(rg Range) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NeedsMerge ¶
func NeedsMerge(left, right *RangeStats, splitSizeBytes, splitKeyCount uint64) bool
NeedsMerge checks whether two ranges needs to be merged.
Types ¶
type DeletedRange ¶
type DeletedRange struct {
// contains filtered or unexported fields
}
type KeyRange ¶
KeyRange represents a origin key range.
func (*KeyRange) ContainsRange ¶
ContainsRange check if the range contains the region's key range.
type ProgressRange ¶
func (*ProgressRange) Less ¶
func (pr *ProgressRange) Less(than *ProgressRange) bool
Less impls btree.Item.
type ProgressRangeTree ¶
type ProgressRangeTree struct {
*btree.BTreeG[*ProgressRange]
// contains filtered or unexported fields
}
ProgressRangeTree is a sorted tree for ProgressRanges. All the progress ranges it sorted do not overlap.
func NewProgressRangeTree ¶
func NewProgressRangeTree(metaWriter *metautil.MetaWriter, skipChecksum bool) ProgressRangeTree
NewProgressRangeTree returns an empty range tree.
func (*ProgressRangeTree) FindContained ¶
func (rangeTree *ProgressRangeTree) FindContained(startKey, endKey []byte) (*ProgressRange, error)
FindContained finds if there is a progress range containing the key range [startKey, endKey).
func (*ProgressRangeTree) GetChecksumMap ¶
func (rangeTree *ProgressRangeTree) GetChecksumMap() map[int64]*metautil.ChecksumStats
GetChecksumMap get the checksum map from physical ID to checksum.
func (*ProgressRangeTree) GetIncompleteRanges ¶
func (rangeTree *ProgressRangeTree) GetIncompleteRanges() ([]*kvrpcpb.KeyRange, error)
func (*ProgressRangeTree) Insert ¶
func (rangeTree *ProgressRangeTree) Insert(pr *ProgressRange) error
Insert inserts a ProgressRange into the tree, it will return an error if there is a overlapping range.
func (*ProgressRangeTree) SetCallBack ¶
func (rangeTree *ProgressRangeTree) SetCallBack(callback func())
SetCallBack set the complete call back to update the progress.
func (*ProgressRangeTree) UpdateChecksum ¶
func (rangeTree *ProgressRangeTree) UpdateChecksum(physicalID int64, crc, kvs, bytes uint64)
type Range ¶
Range represents a backup response.
func (*Range) BytesAndKeys ¶
BytesAndKeys returns total bytes and keys in a range.
type RangeStats ¶
RangeStats represents a restore merge result.
type RangeStatsTree ¶
type RangeStatsTree struct {
*btree.BTreeG[*RangeStats]
}
func NewRangeStatsTree ¶
func NewRangeStatsTree() RangeStatsTree
func (*RangeStatsTree) InsertRange ¶
func (rangeTree *RangeStatsTree) InsertRange(rg *Range, rangeSize, rangeCount uint64) *RangeStats
InsertRange inserts ranges into the range tree. It returns a non-nil range if there are soe overlapped ranges.
func (*RangeStatsTree) MergedRanges ¶
func (rangeTree *RangeStatsTree) MergedRanges(splitSizeBytes, splitKeyCount uint64) []RangeStats
MergedRanges output the sortedRanges having merged according to given `splitSizeBytes` and `splitKeyCount`.
type RangeTree ¶
RangeTree is sorted tree for Ranges. All the ranges it stored do not overlap.
func NewRangeTreeWithFreeListG ¶
NewRangeTreeWithFreeListG returns an empty range tree with the specified free list
func (*RangeTree) Find ¶
Find is a helper function to find an item that contains the range start key.
func (*RangeTree) GetIncompleteRange ¶
GetIncompleteRange returns missing range covered by startKey and endKey.
func (*RangeTree) InsertRange ¶
InsertRange inserts ranges into the range tree. It returns a non-nil range if there are soe overlapped ranges.