Documentation
¶
Index ¶
- func InitMetrics(registry *prometheus.Registry)
- type Owner
- func (o *Owner) AsyncStop()
- func (o *Owner) Bootstrap(state *orchestrator.GlobalReactorState)
- func (o *Owner) CloseAllChangefeeds(ctx cdcContext.Context)
- func (o *Owner) EnqueueJob(adminJob model.AdminJob)
- func (o *Owner) ManualSchedule(cfID model.ChangeFeedID, toCapture model.CaptureID, keyspanID model.KeySpanID)
- func (o *Owner) StatusProvider() StatusProvider
- func (o *Owner) Tick(stdCtx context.Context, rawState orchestrator.ReactorState) (nextState orchestrator.ReactorState, err error)
- func (o *Owner) TriggerRebalance(cfID model.ChangeFeedID)
- func (o *Owner) WriteDebugInfo(w io.Writer)
- type StatusProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMetrics ¶
func InitMetrics(registry *prometheus.Registry)
InitMetrics registers all metrics used in owner
Types ¶
type Owner ¶
type Owner struct {
// contains filtered or unexported fields
}
Owner manages many changefeeds All public functions are THREAD-SAFE, except for Tick, Tick is only used for etcd worker
func NewOwner4Test ¶
NewOwner4Test creates a new Owner for test TODO: modify for tikv cdc
func (*Owner) Bootstrap ¶
func (o *Owner) Bootstrap(state *orchestrator.GlobalReactorState)
Bootstrap checks if the state contains incompatible or incorrect information and tries to fix it.
func (*Owner) CloseAllChangefeeds ¶
func (o *Owner) CloseAllChangefeeds(ctx cdcContext.Context)
CloseAllCaptures close all changefeeds. Note: Please be careful to call this method!
func (*Owner) EnqueueJob ¶
EnqueueJob enqueues an admin job into an internal queue, and the Owner will handle the job in the next tick
func (*Owner) ManualSchedule ¶
func (o *Owner) ManualSchedule(cfID model.ChangeFeedID, toCapture model.CaptureID, keyspanID model.KeySpanID)
ManualSchedule moves a keyspan from a capture to another capture
func (*Owner) StatusProvider ¶
func (o *Owner) StatusProvider() StatusProvider
StatusProvider returns a StatusProvider
func (*Owner) Tick ¶
func (o *Owner) Tick(stdCtx context.Context, rawState orchestrator.ReactorState) (nextState orchestrator.ReactorState, err error)
Tick implements the Reactor interface
func (*Owner) TriggerRebalance ¶
func (o *Owner) TriggerRebalance(cfID model.ChangeFeedID)
TriggerRebalance triggers a rebalance for the specified changefeed
func (*Owner) WriteDebugInfo ¶
WriteDebugInfo writes debug info into the specified http writer
type StatusProvider ¶
type StatusProvider interface { // GetAllChangeFeedStatuses returns all changefeeds' runtime status. GetAllChangeFeedStatuses(ctx context.Context) (map[model.ChangeFeedID]*model.ChangeFeedStatus, error) // GetChangeFeedStatus returns a changefeeds' runtime status. GetChangeFeedStatus(ctx context.Context, changefeedID model.ChangeFeedID) (*model.ChangeFeedStatus, error) // GetAllChangeFeedInfo returns all changefeeds' info. GetAllChangeFeedInfo(ctx context.Context) (map[model.ChangeFeedID]*model.ChangeFeedInfo, error) // GetChangeFeedInfo returns a changefeeds' info. GetChangeFeedInfo(ctx context.Context, changefeedID model.ChangeFeedID) (*model.ChangeFeedInfo, error) // GetAllTaskStatuses returns the task statuses for the specified changefeed. GetAllTaskStatuses(ctx context.Context, changefeedID model.ChangeFeedID) (map[model.CaptureID]*model.TaskStatus, error) // GetTaskPositions returns the task positions for the specified changefeed. GetTaskPositions(ctx context.Context, changefeedID model.ChangeFeedID) (map[model.CaptureID]*model.TaskPosition, error) // GetProcessors returns the statuses of all processors GetProcessors(ctx context.Context) ([]*model.ProcInfoSnap, error) // GetCaptures returns the information about all captures. GetCaptures(ctx context.Context) ([]*model.CaptureInfo, error) }
StatusProvider provide some func to get meta-information from owner