pebble

package
v0.0.0-...-44a46bf Latest Latest
Warning

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

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

Documentation

Overview

Package pebble is an pebble-based EventSortEngine implementation with such properties:

  1. all EventSortEngine instances shares several pebble.DB instances;
  2. keys are encoded with prefix TableID-CRTs-StartTs;
  3. keys are hashed into different pebble.DB instances based on table prefix.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenPebble

func OpenPebble(
	id int, path string, cfg *config.DBConfig,
	cache *pebble.Cache,
	tableCache *pebble.TableCache,
	adjusts ...func(*pebble.Options),
) (db *pebble.DB, err error)

OpenPebble opens a pebble.

Types

type DBBatchEvent

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

DBBatchEvent is used to contains a batch of events and the corresponding resolvedTs info.

type EventIter

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

EventIter implements sorter.EventIterator.

func (*EventIter) Close

func (s *EventIter) Close() error

Close implements sorter.EventIterator.

func (*EventIter) Next

func (s *EventIter) Next() (event *model.PolymorphicEvent, txnFinished sorter.Position, err error)

Next implements sorter.EventIterator. txnFinished indicates whether all events in the current transaction are fetched or not.

type EventSorter

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

EventSorter is an event sort engine.

func New

func New(ID model.ChangeFeedID, dbs []*pebble.DB) *EventSorter

New creates an EventSorter instance.

func (*EventSorter) Add

func (s *EventSorter) Add(span tablepb.Span, events ...*model.PolymorphicEvent)

Add implements sorter.SortEngine.

Panics if the table doesn't exist.

func (*EventSorter) AddTable

func (s *EventSorter) AddTable(span tablepb.Span, startTs model.Ts)

AddTable implements sorter.SortEngine.

func (*EventSorter) CleanAllTables

func (s *EventSorter) CleanAllTables(upperBound sorter.Position) error

CleanAllTables implements sorter.EventSortEngine.

func (*EventSorter) CleanByTable

func (s *EventSorter) CleanByTable(span tablepb.Span, upperBound sorter.Position) error

CleanByTable implements sorter.SortEngine.

func (*EventSorter) Close

func (s *EventSorter) Close() error

Close implements sorter.SortEngine.

func (*EventSorter) FetchAllTables

func (s *EventSorter) FetchAllTables(lowerBound sorter.Position) sorter.EventIterator

FetchAllTables implements sorter.SortEngine.

func (*EventSorter) FetchByTable

func (s *EventSorter) FetchByTable(span tablepb.Span, lowerBound, upperBound sorter.Position) sorter.EventIterator

FetchByTable implements sorter.SortEngine.

func (*EventSorter) GetStatsByTable

func (s *EventSorter) GetStatsByTable(span tablepb.Span) sorter.TableStats

GetStatsByTable implements sorter.SortEngine.

Panics if the table doesn't exist.

func (*EventSorter) IsTableBased

func (s *EventSorter) IsTableBased() bool

IsTableBased implements sorter.SortEngine.

func (*EventSorter) OnResolve

func (s *EventSorter) OnResolve(action func(tablepb.Span, model.Ts))

OnResolve implements sorter.SortEngine.

func (*EventSorter) RemoveTable

func (s *EventSorter) RemoveTable(span tablepb.Span)

RemoveTable implements sorter.SortEngine.

func (*EventSorter) SlotsAndHasher

func (s *EventSorter) SlotsAndHasher() (slotCount int, hasher func(tablepb.Span, int) int)

SlotsAndHasher implements sorter.SortEngine.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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