cases

package
v2.1.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 29, 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 AddNode

type AddNode struct {
	Tick   int64
	NodeID uint64
}

AddNode adds a node

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
	RegionSplitRows int64
	Events          []EventInner

	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.

func (*Conf) NeedSplit

func (c *Conf) NeedSplit(size, rows int64) bool

NeedSplit checks whether the region need to split according it's size and rows.

type EventInner

type EventInner interface {
	Type() string
}

EventInner is a detail template for custom events

type ReadFlowOnRegionInner

type ReadFlowOnRegionInner struct {
	Step func(tick int64) map[uint64]int64
}

ReadFlowOnRegionInner reads bytes in some region

func (*ReadFlowOnRegionInner) Type

func (w *ReadFlowOnRegionInner) Type() string

Type implements the EventInner interface

type Region

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

Region is the config to simulate a region.

type RemoveNode

type RemoveNode struct {
	Tick   int64
	NodeID uint64
}

RemoveNode removes a node

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.

type WriteFlowOnRegionInner

type WriteFlowOnRegionInner struct {
	Step func(tick int64) map[uint64]int64
}

WriteFlowOnRegionInner writes bytes in some region

func (*WriteFlowOnRegionInner) Type

func (w *WriteFlowOnRegionInner) Type() string

Type implements the EventInner interface

type WriteFlowOnSpotInner

type WriteFlowOnSpotInner struct {
	Step func(tick int64) map[string]int64
}

WriteFlowOnSpotInner writes bytes in some range

func (*WriteFlowOnSpotInner) Type

func (w *WriteFlowOnSpotInner) Type() string

Type implements the EventInner interface

Jump to

Keyboard shortcuts

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