Versions in this module Expand all Collapse all v0 v0.1.0 Jun 15, 2023 Changes in this version + const NumberOfEntries + const PluginLoad + const PluginUnload + const StaleEntriesTimeout + var DefaultMinResolvedTSPersistenceInterval = config.DefaultMinResolvedTSPersistenceInterval + var DiagnosableSummaryFunc = map[string]plan.Summary + var ThreadsCollected = []string + func CheckHealth(client *http.Client, members []*pdpb.Member) map[uint64]*pdpb.Member + func GetMembers(etcdClient *clientv3.Client) ([]*pdpb.Member, error) + func IsClientURL(addr string, etcdClient *clientv3.Client) bool + type CPUEntries struct + func NewCPUEntries(size int) *CPUEntries + func (s *CPUEntries) Append(stat *StatEntry, threads ...string) bool + func (s *CPUEntries) CPU() float64 + type DiagnosticResult struct + Name string + Status string + StoreStatus map[uint64]plan.Status + Summary string + Timestamp uint64 + type LoadState int + const LoadStateHigh + const LoadStateIdle + const LoadStateLow + const LoadStateNone + const LoadStateNormal + func (s LoadState) String() string + type RaftCluster struct + func NewRaftCluster(ctx context.Context, clusterID uint64, regionSyncer *syncer.RegionSyncer, ...) *RaftCluster + func (c *RaftCluster) AddScheduler(scheduler schedule.Scheduler, args ...string) error + func (c *RaftCluster) AddStoreLimit(store *metapb.Store) + func (c *RaftCluster) AddSuspectKeyRange(start, end []byte) + func (c *RaftCluster) AddSuspectRegions(regionIDs ...uint64) + func (c *RaftCluster) BucketsStats(degree int, regions ...uint64) map[uint64][]*buckets.BucketStat + func (c *RaftCluster) BuryStore(storeID uint64, forceBury bool) error + func (c *RaftCluster) ClearSuspectKeyRanges() + func (c *RaftCluster) Context() context.Context + func (c *RaftCluster) DeleteStoreLabel(storeID uint64, labelKey string) error + func (c *RaftCluster) DropCacheAllRegion() + func (c *RaftCluster) DropCacheRegion(id uint64) + func (c *RaftCluster) GetAdjacentRegions(region *core.RegionInfo) (*core.RegionInfo, *core.RegionInfo) + func (c *RaftCluster) GetAllStoresLimit() map[uint64]config.StoreLimitConfig + func (c *RaftCluster) GetAllocator() id.Allocator + func (c *RaftCluster) GetAverageRegionSize() int64 + func (c *RaftCluster) GetBasicCluster() *core.BasicCluster + func (c *RaftCluster) GetClusterVersion() string + func (c *RaftCluster) GetCoordinator() *coordinator + func (c *RaftCluster) GetEtcdClient() *clientv3.Client + func (c *RaftCluster) GetExternalTS() uint64 + func (c *RaftCluster) GetFollowerStores(region *core.RegionInfo) []*core.StoreInfo + func (c *RaftCluster) GetHotPeerStat(rw statistics.RWType, regionID, storeID uint64) *statistics.HotPeerStat + func (c *RaftCluster) GetHotReadRegions(storeIDs ...uint64) *statistics.StoreHotPeersInfos + func (c *RaftCluster) GetHotStat() *statistics.HotStat + func (c *RaftCluster) GetHotWriteRegions(storeIDs ...uint64) *statistics.StoreHotPeersInfos + func (c *RaftCluster) GetLeaderStore(region *core.RegionInfo) *core.StoreInfo + func (c *RaftCluster) GetLeaderStoreByRegionID(regionID uint64) *core.StoreInfo + func (c *RaftCluster) GetMergeChecker() *checker.MergeChecker + func (c *RaftCluster) GetMetaCluster() *metapb.Cluster + func (c *RaftCluster) GetMetaRegions() []*metapb.Region + func (c *RaftCluster) GetMetaStores() []*metapb.Store + func (c *RaftCluster) GetMinResolvedTS() uint64 + func (c *RaftCluster) GetNonWitnessVoterStores(region *core.RegionInfo) []*core.StoreInfo + func (c *RaftCluster) GetOfflineRegionStatsByType(typ statistics.RegionStatisticType) []*core.RegionInfo + func (c *RaftCluster) GetOperatorController() *schedule.OperatorController + func (c *RaftCluster) GetOpts() sc.Config + func (c *RaftCluster) GetPDServerConfig() *config.PDServerConfig + func (c *RaftCluster) GetPausedSchedulerDelayAt(name string) (int64, error) + func (c *RaftCluster) GetPausedSchedulerDelayUntil(name string) (int64, error) + func (c *RaftCluster) GetPrevRegionByKey(regionKey []byte) *core.RegionInfo + func (c *RaftCluster) GetProgressByAction(action string) (process, ls, cs float64, err error) + func (c *RaftCluster) GetProgressByID(storeID string) (action string, process, ls, cs float64, err error) + func (c *RaftCluster) GetRangeCount(startKey, endKey []byte) *statistics.RegionStats + func (c *RaftCluster) GetRangeHoles() [][]string + func (c *RaftCluster) GetRegion(regionID uint64) *core.RegionInfo + func (c *RaftCluster) GetRegionByKey(regionKey []byte) *core.RegionInfo + func (c *RaftCluster) GetRegionCount() int + func (c *RaftCluster) GetRegionLabeler() *labeler.RegionLabeler + func (c *RaftCluster) GetRegionScatter() *schedule.RegionScatterer + func (c *RaftCluster) GetRegionSplitter() *schedule.RegionSplitter + func (c *RaftCluster) GetRegionStats(startKey, endKey []byte) *statistics.RegionStats + func (c *RaftCluster) GetRegionStatsByType(typ statistics.RegionStatisticType) []*core.RegionInfo + func (c *RaftCluster) GetRegionStores(region *core.RegionInfo) []*core.StoreInfo + func (c *RaftCluster) GetRegionSyncer() *syncer.RegionSyncer + func (c *RaftCluster) GetRegions() []*core.RegionInfo + func (c *RaftCluster) GetReplicationConfig() *config.ReplicationConfig + func (c *RaftCluster) GetReplicationMode() *replication.ModeManager + func (c *RaftCluster) GetRuleChecker() *checker.RuleChecker + func (c *RaftCluster) GetRuleManager() *placement.RuleManager + func (c *RaftCluster) GetScheduleConfig() *config.ScheduleConfig + func (c *RaftCluster) GetSchedulerHandlers() map[string]http.Handler + func (c *RaftCluster) GetSchedulers() []string + func (c *RaftCluster) GetStorage() storage.Storage + func (c *RaftCluster) GetStore(storeID uint64) *core.StoreInfo + func (c *RaftCluster) GetStoreConfig() sc.StoreConfig + func (c *RaftCluster) GetStoreCount() int + func (c *RaftCluster) GetStoreLimitByType(storeID uint64, typ storelimit.Type) float64 + func (c *RaftCluster) GetStoreLimiter() *StoreLimiter + func (c *RaftCluster) GetStoreMinResolvedTS(storeID uint64) uint64 + func (c *RaftCluster) GetStoreRegionCount(storeID uint64) int + func (c *RaftCluster) GetStoreRegions(storeID uint64) []*core.RegionInfo + func (c *RaftCluster) GetStores() []*core.StoreInfo + func (c *RaftCluster) GetStoresLoads() map[uint64][]float64 + func (c *RaftCluster) GetStoresStats() *statistics.StoresStats + func (c *RaftCluster) GetSuspectRegions() []uint64 + func (c *RaftCluster) GetUnsafeRecoveryController() *unsafeRecoveryController + func (c *RaftCluster) HandleAskBatchSplit(request *pdpb.AskBatchSplitRequest) (*pdpb.AskBatchSplitResponse, error) + func (c *RaftCluster) HandleAskSplit(request *pdpb.AskSplitRequest) (*pdpb.AskSplitResponse, error) + func (c *RaftCluster) HandleBatchReportSplit(request *pdpb.ReportBatchSplitRequest) (*pdpb.ReportBatchSplitResponse, error) + func (c *RaftCluster) HandleRegionHeartbeat(region *core.RegionInfo) error + func (c *RaftCluster) HandleReportBuckets(b *metapb.Buckets) error + func (c *RaftCluster) HandleReportSplit(request *pdpb.ReportSplitRequest) (*pdpb.ReportSplitResponse, error) + func (c *RaftCluster) HandleStoreHeartbeat(heartbeat *pdpb.StoreHeartbeatRequest, resp *pdpb.StoreHeartbeatResponse) error + func (c *RaftCluster) InitCluster(id id.Allocator, opt *config.PersistOptions, storage storage.Storage, ...) + func (c *RaftCluster) IsCheckerPaused(name string) (bool, error) + func (c *RaftCluster) IsPrepared() bool + func (c *RaftCluster) IsRegionHot(region *core.RegionInfo) bool + func (c *RaftCluster) IsRunning() bool + func (c *RaftCluster) IsSchedulerAllowed(name string) (bool, error) + func (c *RaftCluster) IsSchedulerDisabled(name string) (bool, error) + func (c *RaftCluster) IsSchedulerExisted(name string) (bool, error) + func (c *RaftCluster) IsSchedulerPaused(name string) (bool, error) + func (c *RaftCluster) LoadClusterInfo() (*RaftCluster, error) + func (c *RaftCluster) LoadClusterStatus() (*Status, error) + func (c *RaftCluster) NeedAwakenAllRegionsInStore(storeID uint64) (needAwaken bool, slowStoreIDs []uint64) + func (c *RaftCluster) OnStoreVersionChange() + func (c *RaftCluster) PauseLeaderTransfer(storeID uint64) error + func (c *RaftCluster) PauseOrResumeChecker(name string, t int64) error + func (c *RaftCluster) PauseOrResumeScheduler(name string, t int64) error + func (c *RaftCluster) PopOneSuspectKeyRange() ([2][]byte, bool) + func (c *RaftCluster) PutMetaCluster(meta *metapb.Cluster) error + func (c *RaftCluster) PutStore(store *metapb.Store) error + func (c *RaftCluster) RandFollowerRegions(storeID uint64, ranges []core.KeyRange) []*core.RegionInfo + func (c *RaftCluster) RandLeaderRegions(storeID uint64, ranges []core.KeyRange) []*core.RegionInfo + func (c *RaftCluster) RandLearnerRegions(storeID uint64, ranges []core.KeyRange) []*core.RegionInfo + func (c *RaftCluster) RandPendingRegions(storeID uint64, ranges []core.KeyRange) []*core.RegionInfo + func (c *RaftCluster) RandWitnessRegions(storeID uint64, ranges []core.KeyRange) []*core.RegionInfo + func (c *RaftCluster) ReadyToServe(storeID uint64) error + func (c *RaftCluster) RecordOpStepWithTTL(regionID uint64) + func (c *RaftCluster) RegionReadStats() map[uint64][]*statistics.HotPeerStat + func (c *RaftCluster) RegionWriteStats() map[uint64][]*statistics.HotPeerStat + func (c *RaftCluster) RemoveScheduler(name string) error + func (c *RaftCluster) RemoveStore(storeID uint64, physicallyDestroyed bool) error + func (c *RaftCluster) RemoveStoreLimit(storeID uint64) + func (c *RaftCluster) RemoveSuspectRegion(id uint64) + func (c *RaftCluster) RemoveTombStoneRecords() error + func (c *RaftCluster) ResumeLeaderTransfer(storeID uint64) + func (c *RaftCluster) ScanRegions(startKey, endKey []byte, limit int) []*core.RegionInfo + func (c *RaftCluster) SetAllStoresLimit(typ storelimit.Type, ratePerMin float64) error + func (c *RaftCluster) SetAllStoresLimitTTL(typ storelimit.Type, ratePerMin float64, ttl time.Duration) + func (c *RaftCluster) SetExternalTS(timestamp uint64) error + func (c *RaftCluster) SetHotPendingInfluenceMetrics(storeLabel, rwTy, dim string, load float64) + func (c *RaftCluster) SetMinResolvedTS(storeID, minResolvedTS uint64) error + func (c *RaftCluster) SetPDServerConfig(cfg *config.PDServerConfig) + func (c *RaftCluster) SetPrepared() + func (c *RaftCluster) SetScheduleConfig(cfg *config.ScheduleConfig) + func (c *RaftCluster) SetStorage(s storage.Storage) + func (c *RaftCluster) SetStoreLimit(storeID uint64, typ storelimit.Type, ratePerMin float64) error + func (c *RaftCluster) SetStoreWeight(storeID uint64, leaderWeight, regionWeight float64) error + func (c *RaftCluster) SlowStoreEvicted(storeID uint64) error + func (c *RaftCluster) SlowStoreRecovered(storeID uint64) + func (c *RaftCluster) SlowTrendEvicted(storeID uint64) error + func (c *RaftCluster) SlowTrendRecovered(storeID uint64) + func (c *RaftCluster) Start(s Server) error + func (c *RaftCluster) Stop() + func (c *RaftCluster) UpStore(storeID uint64) error + func (c *RaftCluster) UpdateStoreLabels(storeID uint64, labels []*metapb.StoreLabel, force bool) error + func (c *RaftCluster) ValidRequestRegion(reqRegion *metapb.Region) error + type Server interface + GetAllocator func() id.Allocator + GetBasicCluster func() *core.BasicCluster + GetConfig func() *config.Config + GetHBStreams func() *hbstream.HeartbeatStreams + GetKeyspaceGroupManager func() *keyspace.GroupManager + GetMembers func() ([]*pdpb.Member, error) + GetPersistOptions func() *config.PersistOptions + GetRaftCluster func() *RaftCluster + GetStorage func() storage.Storage + IsAPIServiceMode func() bool + ReplicateFileToMember func(ctx context.Context, member *pdpb.Member, name string, data []byte) error + type StageOutput struct + Actions map[string][]string + Details []string + Info string + Time string + type StatEntries struct + func NewStatEntries(size int) *StatEntries + func (cst *StatEntries) Append(stat *StatEntry) bool + func (cst *StatEntries) CPU(excludes ...uint64) float64 + type StatEntry pdpb.StoreStats + type State struct + func NewState() *State + func (cs *State) Collect(stat *StatEntry) + func (cs *State) State(excludes ...uint64) LoadState + type Status struct + IsInitialized bool + RaftBootstrapTime time.Time + ReplicationStatus string + type StoreLimiter struct + func NewStoreLimiter(opt *config.PersistOptions) *StoreLimiter + func (s *StoreLimiter) Collect(stats *pdpb.StoreStats) + func (s *StoreLimiter) ReplaceStoreLimitScene(scene *storelimit.Scene, limitType storelimit.Type) + func (s *StoreLimiter) StoreLimitScene(limitType storelimit.Type) *storelimit.Scene