sourcemanager

package
v0.0.0-...-e04c7cd Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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,
	bdrMode bool,
	enableTableMonitor bool,
	safeModeAtStart 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)

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