owner

package
v0.0.0-...-a345a4b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

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 NewOwner

func NewOwner(pdClient pd.Client) *Owner

NewOwner creates a new Owner

func NewOwner4Test

func NewOwner4Test(
	pdClient pd.Client,
) *Owner

NewOwner4Test creates a new Owner for test TODO: modify for tikv cdc

func (*Owner) AsyncStop

func (o *Owner) AsyncStop()

AsyncStop stops the owner asynchronously

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

func (o *Owner) EnqueueJob(adminJob model.AdminJob)

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

func (o *Owner) WriteDebugInfo(w io.Writer)

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

Jump to

Keyboard shortcuts

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