scheduler

package
v0.0.0-...-0332357 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const CheckpointCannotProceed = internal.CheckpointCannotProceed

CheckpointCannotProceed is a placeholder indicating that the Owner should not advance the global checkpoint TS just yet.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics(registry *prometheus.Registry)

InitMetrics registers all metrics used in scheduler

Types

type Agent

type Agent internal.Agent

Agent is an interface for an object inside Processor that is responsible for receiving commands from the Owner. Ideally the processor should drive the Agent by Tick.

Note that Agent is not thread-safe

func NewAgent

func NewAgent(
	ctx context.Context,
	captureID model.CaptureID,
	liveness *model.Liveness,
	messageServer *p2p.MessageServer,
	messageRouter p2p.MessageRouter,
	ownerInfoClient etcd.OwnerCaptureInfoClient,
	executor TableExecutor,
	changefeedID model.ChangeFeedID,
	changefeedEpoch uint64,
	cfg *config.SchedulerConfig,
) (Agent, error)

NewAgent returns two-phase agent.

type InfoProvider

type InfoProvider internal.InfoProvider

InfoProvider is the interface to get information about the internal states of the scheduler. We need this interface so that we can provide the information through HTTP API.

type Query

type Query internal.Query

Query is for open api can access the scheduler

type Scheduler

type Scheduler internal.Scheduler

Scheduler is an interface for scheduling tables. Since in our design, we do not record checkpoints per table, how we calculate the global watermarks (checkpoint-ts and resolved-ts) is heavily coupled with how tables are scheduled. That is why we have a scheduler interface that also reports the global watermarks.

func NewScheduler

func NewScheduler(
	ctx context.Context,
	captureID model.CaptureID,
	changeFeedID model.ChangeFeedID,
	messageServer *p2p.MessageServer,
	messageRouter p2p.MessageRouter,
	ownerRevision int64,
	changefeedEpoch uint64,
	up *upstream.Upstream,
	cfg *config.SchedulerConfig,
	redoMetaManager redo.MetaManager,
) (Scheduler, error)

NewScheduler returns two-phase scheduler.

type TableExecutor

type TableExecutor internal.TableExecutor

TableExecutor is an abstraction for "Processor".

This interface is so designed that it would be the least problematic to adapt the current Processor implementation to it. TODO find a way to make the semantics easier to understand.

Jump to

Keyboard shortcuts

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