Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetadataManager ¶
type MetadataManager interface { // GetStore gets a store by address. GetStore(addr string) (*store.Store, error) // AddStore adds a new store to the cluster. AddStore(addr string) error // RemoveStore removes a store from the cluster. RemoveStore(addr string) error // GetAllStores gets all stores in the cluster. GetAllStores() []*store.Store // GetRegionByID gets a region by id. GetRegionByID(id uint64) (*region.Region, error) // GetStoreByID gets a store by id. GetStoreByID(id uint64) (*store.Store, error) // ApplyConfig applies a new config to the cluster. ApplyConfig(config *config.Config) error }
MetadataManager manages the metadata of the cluster.
func NewMeta ¶ added in v1.0.12
func NewMeta(conf config.Config) MetadataManager
NewMeta creates a new meta.
type NodeStatus ¶
type RoundRobinScheduler ¶
type RoundRobinScheduler struct {
// contains filtered or unexported fields
}
RoundRobinScheduler is a scheduler that selects nodes in round-robin order.
func (*RoundRobinScheduler) SelectNode ¶
func (r *RoundRobinScheduler) SelectNode(nodes []*NodeStatus, key []byte, num int) (*NodeStatus, error)
SelectNode selects a node in round-robin order.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewRoundRobinScheduler ¶ added in v1.0.5
func NewRoundRobinScheduler(config *SchedulerConfig) *Scheduler
NewRoundRobinScheduler creates a new RoundRobinScheduler.
func (*Scheduler) ScheduleNode ¶
func (s *Scheduler) ScheduleNode(key []byte) (*NodeStatus, error)
ScheduleNode schedules the key to a node.
func (*Scheduler) SetSchedulingStrategy ¶
func (s *Scheduler) SetSchedulingStrategy(strategy SchedulingStrategy)
SetSchedulingStrategy sets the scheduling strategy.
type SchedulerConfig ¶
type SchedulingStrategy ¶
type SchedulingStrategy interface { // SelectNode selects num node to schedule the key. SelectNode(nodes []*NodeStatus, key []byte, num int) (*NodeStatus, error) }
SchedulingStrategy is the interface that wraps the basic SelectNode method.
Click to show internal directories.
Click to hide internal directories.