unified

package
v0.0.0-...-1b33b2a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUp

func CleanUp()

CleanUp cleans up the files that might have been used.

func InitMetrics

func InitMetrics(registry *prometheus.Registry)

InitMetrics registers all metrics in this file

func ResetGlobalPoolWithoutCleanup

func ResetGlobalPoolWithoutCleanup()

ResetGlobalPoolWithoutCleanup reset the pool without cleaning up files. Note that it is used in tests only.

func RunWorkerPool

func RunWorkerPool(ctx context.Context) error

RunWorkerPool runs the worker pool used by the heapSorters It **must** be running for Unified Sorter to work.

Types

type Sorter

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

Sorter provides both sorting in memory and in file. Memory pressure is used to determine which one to use.

func NewUnifiedSorter

func NewUnifiedSorter(
	dir string,
	changeFeedID model.ChangeFeedID,
	keyspanName string,
	keyspanID model.KeySpanID,
	captureAddr string,
) (*Sorter, error)

NewUnifiedSorter creates a new Sorter

func (*Sorter) AddEntry

func (s *Sorter) AddEntry(ctx context.Context, entry *model.PolymorphicEvent)

AddEntry implements the EventSorter interface

func (*Sorter) Output

func (s *Sorter) Output() <-chan *model.PolymorphicEvent

Output implements the EventSorter interface

func (*Sorter) Run

func (s *Sorter) Run(ctx context.Context) error

Run implements the EventSorter interface

func (*Sorter) TryAddEntry

func (s *Sorter) TryAddEntry(ctx context.Context, entry *model.PolymorphicEvent) (bool, error)

TryAddEntry implements the EventSorter interface

Jump to

Keyboard shortcuts

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