sourcemanager

package
v0.0.0-...-3f1ab7e Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PullerSplitUpdateMode

type PullerSplitUpdateMode int32

PullerSplitUpdateMode is the mode to split update events in puller.

const (
	PullerSplitUpdateModeNone    PullerSplitUpdateMode = 0
	PullerSplitUpdateModeAtStart PullerSplitUpdateMode = 1
	PullerSplitUpdateModeAlways  PullerSplitUpdateMode = 2
)

PullerSplitUpdateMode constants.

type SourceManager

type SourceManager struct {
	// contains filtered or unexported fields
}

SourceManager is the manager of the source engine and puller.

func New

func New(
	changefeedID model.ChangeFeedID,
	up *upstream.Upstream,
	mg entry.MounterGroup,
	engine sorter.SortEngine,
	splitUpdateMode PullerSplitUpdateMode,
	bdrMode bool,
	enableTableMonitor bool,
) *SourceManager

New creates a new source manager.

func NewForTest

func NewForTest(
	changefeedID model.ChangeFeedID,
	up *upstream.Upstream,
	mg entry.MounterGroup,
	engine sorter.SortEngine,
	bdrMode bool,
) *SourceManager

NewForTest creates a new source manager for testing.

func (*SourceManager) Add

func (m *SourceManager) Add(span tablepb.Span, events ...*model.PolymorphicEvent)

Add adds events to the engine. It is used for testing.

func (*SourceManager) AddTable

func (m *SourceManager) AddTable(span tablepb.Span, tableName string, startTs model.Ts, getReplicaTs func() model.Ts)

AddTable adds a table to the source manager. Start puller and register table to the engine.

func (*SourceManager) CleanByTable

func (m *SourceManager) CleanByTable(span tablepb.Span, upperBound sorter.Position) error

CleanByTable just wrap the engine's CleanByTable method.

func (*SourceManager) Close

func (m *SourceManager) Close()

Close closes the source manager. Stop all pullers and close the engine. It also implements util.Runnable.

func (*SourceManager) FetchByTable

func (m *SourceManager) FetchByTable(
	span tablepb.Span, lowerBound, upperBound sorter.Position,
	quota *memquota.MemQuota,
) *sorter.MountedEventIter

FetchByTable just wrap the engine's FetchByTable method.

func (*SourceManager) GetTablePullerStats

func (m *SourceManager) GetTablePullerStats(span tablepb.Span) puller.Stats

GetTablePullerStats returns the puller stats of the table.

func (*SourceManager) GetTableSorterStats

func (m *SourceManager) GetTableSorterStats(span tablepb.Span) sorter.TableStats

GetTableSorterStats returns the sorter stats of the table.

func (*SourceManager) OnResolve

func (m *SourceManager) OnResolve(action func(tablepb.Span, model.Ts))

OnResolve just wrap the engine's OnResolve method.

func (*SourceManager) RemoveTable

func (m *SourceManager) RemoveTable(span tablepb.Span)

RemoveTable removes a table from the source manager. Stop puller and unregister table from the engine.

func (*SourceManager) Run

func (m *SourceManager) Run(ctx context.Context, _ ...chan<- error) error

Run implements util.Runnable.

func (*SourceManager) WaitForReady

func (m *SourceManager) WaitForReady(ctx context.Context)

WaitForReady implements util.Runnable.

Directories

Path Synopsis
memory
Package memory is an in-memory table based EventSortEngine implementation.
Package memory is an in-memory table based EventSortEngine implementation.
mock
Package mock_sorter is a generated GoMock package.
Package mock_sorter is a generated GoMock package.
pebble
Package pebble is an pebble-based EventSortEngine implementation with such properties:
Package pebble is an pebble-based EventSortEngine implementation with such properties:

Jump to

Keyboard shortcuts

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