Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
GetClusterID(ctx context.Context) uint64
AllocID(ctx context.Context) (uint64, error)
Bootstrap(ctx context.Context, store *metapb.Store, region *metapb.Region) error
PutStore(ctx context.Context, store *metapb.Store) error
StoreHeartbeat(ctx context.Context, stats *pdpb.StoreStats) error
RegionHeartbeat(ctx context.Context, region *core.RegionInfo) error
Close()
}
Client is a PD (Placement Driver) client. It should not be used after calling Close().
type ClusterInfo ¶
type ClusterInfo struct {
*core.RegionsInfo
Nodes map[uint64]*Node
// contains filtered or unexported fields
}
ClusterInfo records all cluster information.
func NewClusterInfo ¶
func NewClusterInfo(pdAddr string, conf *cases.Conf) (*ClusterInfo, error)
NewClusterInfo creates the initialized cluster with config.
func (*ClusterInfo) AddTask ¶
func (c *ClusterInfo) AddTask(task Task)
AddTask adds task in specify node.
func (*ClusterInfo) GetBootstrapInfo ¶
GetBootstrapInfo returns a valid bootstrap store and region.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver promotes the cluster status change.
type Event ¶
type Event interface {
Run(tick int64, cs *ClusterInfo) bool
}
Event that affect the status of the cluster
type EventRunner ¶
type EventRunner struct {
// contains filtered or unexported fields
}
EventRunner includes all events
func NewEventRunner ¶
func NewEventRunner(events []cases.EventInner) *EventRunner
NewEventRunner news a event runner
func (*EventRunner) Tick ¶
func (er *EventRunner) Tick(tick int64, cs *ClusterInfo)
Tick ticks the event run
type ReadFlowOnRegion ¶
type ReadFlowOnRegion struct {
// contains filtered or unexported fields
}
ReadFlowOnRegion reads bytes in some region
func (*ReadFlowOnRegion) Run ¶
func (w *ReadFlowOnRegion) Run(tick int64, cs *ClusterInfo) bool
Run implements the event interface
type Task ¶
type Task interface {
Desc() string
RegionID() uint64
Step(cluster *ClusterInfo)
TargetStoreID() uint64
IsFinished() bool
}
Task running in node.
type WriteFlowOnRegion ¶
type WriteFlowOnRegion struct {
// contains filtered or unexported fields
}
WriteFlowOnRegion writes bytes in some region
func (*WriteFlowOnRegion) Run ¶
func (w *WriteFlowOnRegion) Run(tick int64, cs *ClusterInfo) bool
Run implements the event interface
type WriteFlowOnSpot ¶
type WriteFlowOnSpot struct {
// contains filtered or unexported fields
}
WriteFlowOnSpot writes bytes in some range
func (*WriteFlowOnSpot) Run ¶
func (w *WriteFlowOnSpot) Run(tick int64, cs *ClusterInfo) bool
Run implements the event interface