events

package
v0.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitShardedTableLoad = TableLoadState(4)
	TableLoadBegin       = TableLoadState(1)
	TableLoadEnd         = TableLoadState(2)
	DoneShardedTableLoad = TableLoadState(3)
)

It is important for serialization not to use iota

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupEvent

type CleanupEvent abstract.TableID

TODO: Remove after new cleanup design based on TableLoadEvents

func (*CleanupEvent) String

func (c *CleanupEvent) String() string

type ColumnValues

type ColumnValues interface {
	Value(i int) base.Value
	Column() base.Column
}

type DefaultDeleteEvent

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

func NewDefaultDeleteEvent

func NewDefaultDeleteEvent(table base.Table) *DefaultDeleteEvent

func NewDefaultDeleteEventWithValues

func NewDefaultDeleteEventWithValues(table base.Table, oldValues []base.Value) (*DefaultDeleteEvent, error)

func (*DefaultDeleteEvent) AddOldValue

func (event *DefaultDeleteEvent) AddOldValue(value base.Value) error

func (*DefaultDeleteEvent) OldValue

func (event *DefaultDeleteEvent) OldValue(i int) base.Value

func (*DefaultDeleteEvent) OldValuesCount

func (event *DefaultDeleteEvent) OldValuesCount() int

func (*DefaultDeleteEvent) Table

func (event *DefaultDeleteEvent) Table() base.Table

func (*DefaultDeleteEvent) ToOldChangeItem

func (event *DefaultDeleteEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

type DefaultInsertEvent

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

func NewDefaultInsertEvent

func NewDefaultInsertEvent(table base.Table) *DefaultInsertEvent

func NewDefaultInsertEventWithValues

func NewDefaultInsertEventWithValues(table base.Table, newValues []base.Value) (*DefaultInsertEvent, error)

func (*DefaultInsertEvent) AddNewValue

func (event *DefaultInsertEvent) AddNewValue(value base.Value) error

func (*DefaultInsertEvent) NewValue

func (event *DefaultInsertEvent) NewValue(i int) (base.Value, error)

func (*DefaultInsertEvent) NewValuesCount

func (event *DefaultInsertEvent) NewValuesCount() int

func (*DefaultInsertEvent) Table

func (event *DefaultInsertEvent) Table() base.Table

func (*DefaultInsertEvent) ToOldChangeItem

func (event *DefaultInsertEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

type DefaultLoggedDeleteEvent

type DefaultLoggedDeleteEvent struct {
	DefaultDeleteEvent
	// contains filtered or unexported fields
}

func NewDefaultLoggedDeleteEvent

func NewDefaultLoggedDeleteEvent(
	table base.Table,
	position base.LogPosition,
) *DefaultLoggedDeleteEvent

func NewDefaultLoggedDeleteEventWithValues

func NewDefaultLoggedDeleteEventWithValues(
	table base.Table,
	position base.LogPosition,
	oldValues []base.Value,
) (*DefaultLoggedDeleteEvent, error)

func (*DefaultLoggedDeleteEvent) Position

func (event *DefaultLoggedDeleteEvent) Position() base.LogPosition

func (*DefaultLoggedDeleteEvent) ToOldChangeItem

func (event *DefaultLoggedDeleteEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

type DefaultLoggedInsertEvent

type DefaultLoggedInsertEvent struct {
	DefaultInsertEvent
	// contains filtered or unexported fields
}

func NewDefaultLoggedInsertEvent

func NewDefaultLoggedInsertEvent(
	table base.Table,
	position base.LogPosition,
) *DefaultLoggedInsertEvent

func NewDefaultLoggedInsertEventWithValues

func NewDefaultLoggedInsertEventWithValues(
	table base.Table,
	position base.LogPosition,
	newValues []base.Value,
) (*DefaultLoggedInsertEvent, error)

func (*DefaultLoggedInsertEvent) Position

func (event *DefaultLoggedInsertEvent) Position() base.LogPosition

func (*DefaultLoggedInsertEvent) ToOldChangeItem

func (event *DefaultLoggedInsertEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

type DefaultLoggedUpdateEvent

type DefaultLoggedUpdateEvent struct {
	DefaultUpdateEvent
	// contains filtered or unexported fields
}

func NewDefaultLoggedUpdateEvent

func NewDefaultLoggedUpdateEvent(
	table base.Table,
	position base.LogPosition,
) *DefaultLoggedUpdateEvent

func NewDefaultLoggedUpdateEventWithValues

func NewDefaultLoggedUpdateEventWithValues(
	table base.Table,
	position base.LogPosition,
	newValues []base.Value,
	oldValues []base.Value,
) (*DefaultLoggedUpdateEvent, error)

func (*DefaultLoggedUpdateEvent) Position

func (event *DefaultLoggedUpdateEvent) Position() base.LogPosition

func (*DefaultLoggedUpdateEvent) ToOldChangeItem

func (event *DefaultLoggedUpdateEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

type DefaultTableLoadEvent

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

func NewDefaultTableLoadEvent

func NewDefaultTableLoadEvent(table base.Table, state TableLoadState) *DefaultTableLoadEvent

func (*DefaultTableLoadEvent) State

func (event *DefaultTableLoadEvent) State() TableLoadState

func (*DefaultTableLoadEvent) String

func (event *DefaultTableLoadEvent) String() string

func (*DefaultTableLoadEvent) Table

func (event *DefaultTableLoadEvent) Table() base.Table

func (*DefaultTableLoadEvent) ToOldChangeItem

func (event *DefaultTableLoadEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

func (*DefaultTableLoadEvent) WithPart

func (event *DefaultTableLoadEvent) WithPart(part string) *DefaultTableLoadEvent

type DefaultTransactionEvent

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

func NewDefaultTransactionEvent

func NewDefaultTransactionEvent(position base.LogPosition, transaction base.Transaction, state TransactionState) *DefaultTransactionEvent

func (*DefaultTransactionEvent) Position

func (event *DefaultTransactionEvent) Position() base.LogPosition

func (*DefaultTransactionEvent) State

func (*DefaultTransactionEvent) Transaction

func (event *DefaultTransactionEvent) Transaction() base.Transaction

type DefaultTransactionalDeleteEvent

type DefaultTransactionalDeleteEvent struct {
	DefaultLoggedDeleteEvent
	// contains filtered or unexported fields
}

func NewDefaultTransactionalDeleteEvent

func NewDefaultTransactionalDeleteEvent(
	table base.Table,
	position base.LogPosition,
	transaction base.Transaction,
) *DefaultTransactionalDeleteEvent

func NewDefaultTransactionalDeleteEventWithValues

func NewDefaultTransactionalDeleteEventWithValues(
	table base.Table,
	position base.LogPosition,
	transaction base.Transaction,
	oldValues []base.Value,
) (*DefaultTransactionalDeleteEvent, error)

func (*DefaultTransactionalDeleteEvent) ToOldChangeItem

func (event *DefaultTransactionalDeleteEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

func (*DefaultTransactionalDeleteEvent) Transaction

func (event *DefaultTransactionalDeleteEvent) Transaction() base.Transaction

type DefaultTransactionalInsertEvent

type DefaultTransactionalInsertEvent struct {
	DefaultLoggedInsertEvent
	// contains filtered or unexported fields
}

func NewDefaultTransactionalInsertEvent

func NewDefaultTransactionalInsertEvent(
	table base.Table,
	position base.LogPosition,
	transaction base.Transaction,
) *DefaultTransactionalInsertEvent

func NewDefaultTransactionalInsertEventWithValues

func NewDefaultTransactionalInsertEventWithValues(
	table base.Table,
	position base.LogPosition,
	transaction base.Transaction,
	newValues []base.Value,
) (*DefaultTransactionalInsertEvent, error)

func (*DefaultTransactionalInsertEvent) ToOldChangeItem

func (event *DefaultTransactionalInsertEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

func (*DefaultTransactionalInsertEvent) Transaction

func (event *DefaultTransactionalInsertEvent) Transaction() base.Transaction

type DefaultTransactionalUpdateEvent

type DefaultTransactionalUpdateEvent struct {
	DefaultLoggedUpdateEvent
	// contains filtered or unexported fields
}

func NewDefaultTransactionalUpdateEvent

func NewDefaultTransactionalUpdateEvent(
	table base.Table,
	position base.LogPosition,
	transaction base.Transaction,
) *DefaultTransactionalUpdateEvent

func NewDefaultTransactionalUpdateEventWithValues

func NewDefaultTransactionalUpdateEventWithValues(
	table base.Table,
	position base.LogPosition,
	transaction base.Transaction,
	newValues []base.Value,
	oldValues []base.Value,
) (*DefaultTransactionalUpdateEvent, error)

func (*DefaultTransactionalUpdateEvent) ToOldChangeItem

func (event *DefaultTransactionalUpdateEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

func (*DefaultTransactionalUpdateEvent) Transaction

func (event *DefaultTransactionalUpdateEvent) Transaction() base.Transaction

type DefaultUpdateEvent

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

func NewDefaultUpdateEvent

func NewDefaultUpdateEvent(table base.Table) *DefaultUpdateEvent

func NewDefaultUpdateEventWithValues

func NewDefaultUpdateEventWithValues(table base.Table, newValues []base.Value, oldValues []base.Value) (*DefaultUpdateEvent, error)

func (*DefaultUpdateEvent) AddNewValue

func (event *DefaultUpdateEvent) AddNewValue(value base.Value) error

func (*DefaultUpdateEvent) AddOldValue

func (event *DefaultUpdateEvent) AddOldValue(value base.Value) error

func (*DefaultUpdateEvent) NewValue

func (event *DefaultUpdateEvent) NewValue(i int) base.Value

func (*DefaultUpdateEvent) NewValuesCount

func (event *DefaultUpdateEvent) NewValuesCount() int

func (*DefaultUpdateEvent) OldValue

func (event *DefaultUpdateEvent) OldValue(i int) base.Value

func (*DefaultUpdateEvent) OldValuesCount

func (event *DefaultUpdateEvent) OldValuesCount() int

func (*DefaultUpdateEvent) Table

func (event *DefaultUpdateEvent) Table() base.Table

func (*DefaultUpdateEvent) ToOldChangeItem

func (event *DefaultUpdateEvent) ToOldChangeItem() (*abstract.ChangeItem, error)

type DeleteEvent

type DeleteEvent interface {
	base.SupportsOldChangeItem
	Table() base.Table
	OldValuesCount() int
	OldValue(i int) base.Value
}

type InsertBuilder

type InsertBuilder interface {
	Column(colName string, val interface{}) InsertBuilder
	Build() (InsertEvent, error)
	FromMap(record map[string]interface{}) InsertBuilder
}

func NewDefaultInsertBuilder

func NewDefaultInsertBuilder(table base.Table) InsertBuilder

type InsertEvent

type InsertEvent interface {
	base.SupportsOldChangeItem
	Table() base.Table
	NewValuesCount() int
	NewValue(i int) (base.Value, error)
}

type LoggedDeleteEvent

type LoggedDeleteEvent interface {
	base.LoggedEvent
	DeleteEvent
}

type LoggedInsertEvent

type LoggedInsertEvent interface {
	base.LoggedEvent
	InsertEvent
}

type LoggedUpdateEvent

type LoggedUpdateEvent interface {
	base.LoggedEvent
	UpdateEvent
}

type RowBuilder

type RowBuilder interface {
	AddValue(val base.Value)
}

type SynchronizeEvent

type SynchronizeEvent interface {
	base.Event
	base.SupportsOldChangeItem
}

func NewDefaultSynchronizeEvent

func NewDefaultSynchronizeEvent(tbl base.Table, partID string) SynchronizeEvent

type TableEventsBuilder

type TableEventsBuilder interface {
	AddRow() RowBuilder
	AsBatch() base.EventBatch
}

func NewTableEventsBuilder

func NewTableEventsBuilder(table base.Table) TableEventsBuilder

type TableLoadEvent

type TableLoadEvent interface {
	base.Event
	base.SupportsOldChangeItem
	Table() base.Table
	State() TableLoadState
}

type TableLoadState

type TableLoadState int

func (TableLoadState) String

func (s TableLoadState) String() string

type TransactionEvent

type TransactionEvent interface {
	base.TransactionalEvent
	State() TransactionState
}

type TransactionState

type TransactionState int
const (
	TransactionBegin  TransactionState = TransactionState(1)
	TransactionCommit TransactionState = TransactionState(2)
)

It is important for serialization not to use iota

type TransactionalDeleteEvent

type TransactionalDeleteEvent interface {
	base.TransactionalEvent
	LoggedDeleteEvent
}

type TransactionalInsertEvent

type TransactionalInsertEvent interface {
	base.TransactionalEvent
	LoggedInsertEvent
}

type TransactionalUpdateEvent

type TransactionalUpdateEvent interface {
	base.TransactionalEvent
	LoggedUpdateEvent
}

type UpdateEvent

type UpdateEvent interface {
	base.SupportsOldChangeItem
	Table() base.Table
	NewValuesCount() int
	NewValue(i int) base.Value
	OldValuesCount() int
	OldValue(i int) base.Value
}

Jump to

Keyboard shortcuts

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