cases

package
v2.0.0-rc.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckerFunc

type CheckerFunc func(*core.RegionsInfo) bool

CheckerFunc checks if the scheduler is finished.

type Conf

type Conf struct {
	Stores          []Store
	Regions         []Region
	MaxID           uint64
	RegionSplitSize int64

	WrittenBytes func(tick int64) map[string]int64 // To simulate region grow.

	RegionWriteBytes func(tick int64) map[uint64]int64 // To simulate write flow.
	RegionReadBytes  func(tick int64) map[uint64]int64 // To simulate read flow.

	Checker CheckerFunc // To check the schedule is finished.
}

Conf represents a test suite for simulator.

func NewConf

func NewConf(name string) *Conf

NewConf creates a config to initialize simulator cluster.

type Region

type Region struct {
	ID     uint64
	Peers  []*metapb.Peer
	Leader *metapb.Peer
	Size   int64
}

Region is the config to simulate a region.

type Store

type Store struct {
	ID           uint64
	Status       metapb.StoreState
	Labels       []metapb.StoreLabel
	Capacity     uint64
	Available    uint64
	LeaderWeight float32
	RegionWeight float32
}

Store is the config to simulate tikv.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL