Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCheckPeerTask ¶
NewCheckPeerTask creates task to update peerInfo
func NewCollectBucketStatsTask ¶
NewCollectBucketStatsTask creates task to collect bucket stats.
Types ¶
type BucketStat ¶
type BucketStat struct { RegionID uint64 StartKey []byte EndKey []byte HotDegree int Interval uint64 // the order should see statistics.RegionStatKind Loads []uint64 }
BucketStat is the record the bucket statistics.
func (*BucketStat) String ¶
func (b *BucketStat) String() string
type BucketStatInformer ¶
type BucketStatInformer interface {
BucketsStats(degree int, regions ...uint64) map[uint64][]*BucketStat
}
BucketStatInformer is used to get the bucket statistics.
type BucketTreeItem ¶
type BucketTreeItem struct {
// contains filtered or unexported fields
}
BucketTreeItem is the item of the bucket btree.
func (*BucketTreeItem) GetEndKey ¶
func (b *BucketTreeItem) GetEndKey() []byte
GetEndKey return the end key of the bucket tree item.
func (*BucketTreeItem) GetStartKey ¶
func (b *BucketTreeItem) GetStartKey() []byte
GetStartKey returns the start key of the bucket tree.
func (*BucketTreeItem) Less ¶
func (b *BucketTreeItem) Less(than rangetree.RangeItem) bool
Less returns true if the start key is less than the other.
func (*BucketTreeItem) String ¶
func (b *BucketTreeItem) String() string
String implements the fmt.Stringer interface.
type HotBucketCache ¶
type HotBucketCache struct {
// contains filtered or unexported fields
}
HotBucketCache is the cache of hot stats.
func NewBucketsCache ¶
func NewBucketsCache(ctx context.Context) *HotBucketCache
NewBucketsCache is the constructor for HotBucketCache.
func (*HotBucketCache) CheckAsync ¶
func (h *HotBucketCache) CheckAsync(task flowBucketsItemTask) bool
CheckAsync returns true if the task queue is not full.
func (*HotBucketCache) GetHotBucketStats ¶
func (h *HotBucketCache) GetHotBucketStats(degree int, regions []uint64) map[uint64][]*BucketStat
GetHotBucketStats returns the hot stats of the regions that great than degree.