Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CaseMap = map[string]func(*config.SimConfig) *Case{
"balance-leader": newBalanceLeader,
"redundant-balance-region": newRedundantBalanceRegion,
"scale-in-out": newScaleInOut,
"region-split": newRegionSplit,
"region-merge": newRegionMerge,
"hot-read": newHotRead,
"hot-write": newHotWrite,
"makeup-down-replicas": newMakeupDownReplicas,
"import-data": newImportData,
"diagnose-rule1": newRule1,
"diagnose-rule2": newRule2,
"diagnose-label-not-match1": newLabelNotMatch1,
"diagnose-label-isolation1": newLabelIsolation1,
"diagnose-label-isolation2": newLabelIsolation2,
"stable": newStableEnv,
}
CaseMap is a mapping of the cases to the their corresponding initialize functions.
var IDAllocator idAllocator
IDAllocator is used to alloc unique ID.
Functions ¶
This section is empty.
Types ¶
type AddNodesDescriptor ¶
AddNodesDescriptor adds nodes.
func (*AddNodesDescriptor) Type ¶
func (*AddNodesDescriptor) Type() string
Type implements the EventDescriptor interface.
type Case ¶
type Case struct { Stores []*Store Regions []Region RegionSplitSize int64 RegionSplitKeys int64 Events []EventDescriptor TableNumber int Checker CheckerFunc // To check the schedule is finished. Rules []*pdHttp.Rule Labels typeutil.StringSlice }
Case represents a test suite for simulator.
type CheckerFunc ¶
type CheckerFunc func([]*metapb.Store, *core.RegionsInfo, []info.StoreStats) bool
CheckerFunc checks if the scheduler is finished.
type DeleteNodesDescriptor ¶
DeleteNodesDescriptor removes nodes.
func (*DeleteNodesDescriptor) Type ¶
func (*DeleteNodesDescriptor) Type() string
Type implements the EventDescriptor interface.
type EventDescriptor ¶
type EventDescriptor interface {
Type() string
}
EventDescriptor is a detail template for custom events.
type ReadFlowOnRegionDescriptor ¶
ReadFlowOnRegionDescriptor reads bytes in some region.
func (*ReadFlowOnRegionDescriptor) Type ¶
func (*ReadFlowOnRegionDescriptor) Type() string
Type implements the EventDescriptor interface.
type Store ¶
type Store struct { ID uint64 Status metapb.StoreState Labels []*metapb.StoreLabel Capacity uint64 LeaderWeight float32 RegionWeight float32 Version string HasExtraUsedSpace bool }
Store is used to simulate tikv.
type WriteFlowOnRegionDescriptor ¶
WriteFlowOnRegionDescriptor writes bytes in some region.
func (*WriteFlowOnRegionDescriptor) Type ¶
func (*WriteFlowOnRegionDescriptor) Type() string
Type implements the EventDescriptor interface.
type WriteFlowOnSpotDescriptor ¶
WriteFlowOnSpotDescriptor writes bytes in some range.
func (*WriteFlowOnSpotDescriptor) Type ¶
func (*WriteFlowOnSpotDescriptor) Type() string
Type implements the EventDescriptor interface.