Documentation ¶
Index ¶
Constants ¶
const ( B = 1 << (iota * 10) KB MB GB TB )
unit of storage
Variables ¶
var CaseMap = map[string]func() *Case{
"balance-leader": newBalanceLeader,
"redundant-balance-region": newRedundantBalanceRegion,
"add-nodes": newAddNodes,
"add-nodes-dynamic": newAddNodesDynamic,
"delete-nodes": newDeleteNodes,
"region-split": newRegionSplit,
"region-merge": newRegionMerge,
"hot-read": newHotRead,
"hot-write": newHotWrite,
"makeup-down-replicas": newMakeupDownReplicas,
"import-data": newImportData,
}
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 (w *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. }
Case represents a test suite for simulator.
type CheckerFunc ¶
type CheckerFunc func(*core.RegionsInfo, []info.StoreStats) bool
CheckerFunc checks if the scheduler is finished.
type DeleteNodesDescriptor ¶
DeleteNodesDescriptor removes nodes.
func (*DeleteNodesDescriptor) Type ¶
func (w *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 (w *ReadFlowOnRegionDescriptor) Type() string
Type implements the EventDescriptor interface.
type Store ¶
type Store struct { ID uint64 Status metapb.StoreState Labels []*metapb.StoreLabel Capacity uint64 Available uint64 LeaderWeight float32 RegionWeight float32 Version string }
Store is used to simulate tikv.
type WriteFlowOnRegionDescriptor ¶
WriteFlowOnRegionDescriptor writes bytes in some region.
func (*WriteFlowOnRegionDescriptor) Type ¶
func (w *WriteFlowOnRegionDescriptor) Type() string
Type implements the EventDescriptor interface.
type WriteFlowOnSpotDescriptor ¶
WriteFlowOnSpotDescriptor writes bytes in some range.
func (*WriteFlowOnSpotDescriptor) Type ¶
func (w *WriteFlowOnSpotDescriptor) Type() string
Type implements the EventDescriptor interface.