Documentation
¶
Index ¶
- Constants
- type AssignShardScheduler
- type Manager
- type ManagerImpl
- func (m *ManagerImpl) ListScheduler() []Scheduler
- func (m *ManagerImpl) Scheduler(ctx context.Context, clusterSnapshot metadata.Snapshot) []ScheduleResult
- func (m *ManagerImpl) Start(ctx context.Context) error
- func (m *ManagerImpl) Stop(ctx context.Context) error
- func (m *ManagerImpl) UpdateEnableSchedule(_ context.Context, enableSchedule bool)
- type RebalancedShardScheduler
- type ScheduleResult
- type Scheduler
- func NewAssignShardScheduler(factory *coordinator.Factory, nodePicker coordinator.NodePicker) Scheduler
- func NewRebalancedShardScheduler(logger *zap.Logger, factory *coordinator.Factory, ...) Scheduler
- func NewStaticTopologyShardScheduler(factory *coordinator.Factory, nodePicker coordinator.NodePicker) Scheduler
- type StaticTopologyShardScheduler
Constants ¶
View Source
const (
AssignReason = "ShardView exists in metadata but shardNode not exists, assign shard to node"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignShardScheduler ¶
type AssignShardScheduler struct {
// contains filtered or unexported fields
}
AssignShardScheduler used to assigning shards without nodes.
func (AssignShardScheduler) Schedule ¶
func (a AssignShardScheduler) Schedule(ctx context.Context, clusterSnapshot metadata.Snapshot) (ScheduleResult, error)
type Manager ¶
type Manager interface {
ListScheduler() []Scheduler
Start(ctx context.Context) error
Stop(ctx context.Context) error
UpdateEnableSchedule(ctx context.Context, enableSchedule bool)
// Scheduler will be called when received new heartbeat, every scheduler registered in schedulerManager will be called to generate procedures.
// Scheduler cloud be schedule with fix time interval or heartbeat.
Scheduler(ctx context.Context, clusterSnapshot metadata.Snapshot) []ScheduleResult
}
Manager used to manage schedulers, it will register all schedulers when it starts.
Each registered scheduler will generate procedures if the cluster topology matches the scheduling condition.
func NewManager ¶
func NewManager(logger *zap.Logger, procedureManager procedure.Manager, factory *coordinator.Factory, clusterMetadata *metadata.ClusterMetadata, client *clientv3.Client, rootPath string, enableSchedule bool, topologyType storage.TopologyType) Manager
type ManagerImpl ¶
type ManagerImpl struct {
// contains filtered or unexported fields
}
func (*ManagerImpl) ListScheduler ¶
func (m *ManagerImpl) ListScheduler() []Scheduler
func (*ManagerImpl) Scheduler ¶
func (m *ManagerImpl) Scheduler(ctx context.Context, clusterSnapshot metadata.Snapshot) []ScheduleResult
func (*ManagerImpl) UpdateEnableSchedule ¶
func (m *ManagerImpl) UpdateEnableSchedule(_ context.Context, enableSchedule bool)
type RebalancedShardScheduler ¶
type RebalancedShardScheduler struct {
// contains filtered or unexported fields
}
func (RebalancedShardScheduler) Schedule ¶
func (r RebalancedShardScheduler) Schedule(ctx context.Context, clusterSnapshot metadata.Snapshot) (ScheduleResult, error)
type ScheduleResult ¶
type Scheduler ¶
type Scheduler interface {
// Schedule will generate procedure based on current cluster snapshot, which will be submitted to ProcedureManager, and whether it is actually executed depends on the current state of ProcedureManager.
Schedule(ctx context.Context, clusterSnapshot metadata.Snapshot) (ScheduleResult, error)
}
func NewAssignShardScheduler ¶
func NewAssignShardScheduler(factory *coordinator.Factory, nodePicker coordinator.NodePicker) Scheduler
func NewRebalancedShardScheduler ¶
func NewRebalancedShardScheduler(logger *zap.Logger, factory *coordinator.Factory, nodePicker coordinator.NodePicker) Scheduler
func NewStaticTopologyShardScheduler ¶
func NewStaticTopologyShardScheduler(factory *coordinator.Factory, nodePicker coordinator.NodePicker) Scheduler
type StaticTopologyShardScheduler ¶
type StaticTopologyShardScheduler struct {
// contains filtered or unexported fields
}
func (*StaticTopologyShardScheduler) Schedule ¶
func (s *StaticTopologyShardScheduler) Schedule(ctx context.Context, clusterSnapshot metadata.Snapshot) (ScheduleResult, error)
Click to show internal directories.
Click to hide internal directories.