Documentation ¶
Overview ¶
Package pebble is an pebble-based EventSortEngine implementation with such properties:
- all EventSortEngine instances shares several pebble.DB instances;
- keys are encoded with prefix TableID-CRTs-StartTs;
- keys are hashed into different pebble.DB instances based on table prefix.
Index ¶
- func OpenPebble(id int, path string, cfg *config.DBConfig, cache *pebble.Cache, ...) (db *pebble.DB, err error)
- type DBBatchEvent
- type EventIter
- type EventSorter
- func (s *EventSorter) Add(span tablepb.Span, events ...*model.PolymorphicEvent)
- func (s *EventSorter) AddTable(span tablepb.Span, startTs model.Ts)
- func (s *EventSorter) CleanAllTables(upperBound sorter.Position) error
- func (s *EventSorter) CleanByTable(span tablepb.Span, upperBound sorter.Position) error
- func (s *EventSorter) Close() error
- func (s *EventSorter) FetchAllTables(lowerBound sorter.Position) sorter.EventIterator
- func (s *EventSorter) FetchByTable(span tablepb.Span, lowerBound, upperBound sorter.Position) sorter.EventIterator
- func (s *EventSorter) GetStatsByTable(span tablepb.Span) sorter.TableStats
- func (s *EventSorter) IsTableBased() bool
- func (s *EventSorter) OnResolve(action func(tablepb.Span, model.Ts))
- func (s *EventSorter) RemoveTable(span tablepb.Span)
- func (s *EventSorter) SlotsAndHasher() (slotCount int, hasher func(tablepb.Span, int) int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
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 ¶
CleanByTable 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 ¶
SlotsAndHasher implements sorter.SortEngine.