Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnsDispatcher ¶
type ColumnsDispatcher struct { Columns []string // contains filtered or unexported fields }
ColumnsDispatcher is a partition dispatcher which dispatches events based on the given columns.
func NewColumnsDispatcher ¶
func NewColumnsDispatcher(columns []string) *ColumnsDispatcher
NewColumnsDispatcher creates a ColumnsDispatcher.
func (*ColumnsDispatcher) DispatchRowChangedEvent ¶
func (r *ColumnsDispatcher) DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) (int32, string, error)
DispatchRowChangedEvent returns the target partition to which a row changed event should be dispatched.
type DefaultDispatcher ¶
type DefaultDispatcher struct {
// contains filtered or unexported fields
}
DefaultDispatcher is the default partition dispatcher.
func NewDefaultDispatcher ¶
func NewDefaultDispatcher() *DefaultDispatcher
NewDefaultDispatcher creates a DefaultDispatcher.
func (*DefaultDispatcher) DispatchRowChangedEvent ¶
func (d *DefaultDispatcher) DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) (int32, string, error)
DispatchRowChangedEvent returns the target partition to which a row changed event should be dispatched.
type Dispatcher ¶
type Dispatcher interface { // DispatchRowChangedEvent returns an index of partitions or a partition key // according to RowChangedEvent. // Concurrency Note: This method is thread-safe. DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) (int32, string, error) }
Dispatcher is an abstraction for dispatching rows into different partitions
type IndexValueDispatcher ¶
type IndexValueDispatcher struct { IndexName string // contains filtered or unexported fields }
IndexValueDispatcher is a partition dispatcher which dispatches events based on the index value.
func NewIndexValueDispatcher ¶
func NewIndexValueDispatcher(indexName string) *IndexValueDispatcher
NewIndexValueDispatcher creates a IndexValueDispatcher.
func (*IndexValueDispatcher) DispatchRowChangedEvent ¶
func (r *IndexValueDispatcher) DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) (int32, string, error)
DispatchRowChangedEvent returns the target partition to which a row changed event should be dispatched.
type KeyDispatcher ¶
type KeyDispatcher struct {
// contains filtered or unexported fields
}
KeyDispatcher is a partition dispatcher which dispatches events using the provided partition key.
func NewKeyDispatcher ¶
func NewKeyDispatcher(partitionKey string) *KeyDispatcher
NewKeyDispatcher creates a TableDispatcher.
func (*KeyDispatcher) DispatchRowChangedEvent ¶
func (t *KeyDispatcher) DispatchRowChangedEvent(*model.RowChangedEvent, int32) (int32, string, error)
DispatchRowChangedEvent returns the target partition to which a row changed event should be dispatched.
type TableDispatcher ¶
type TableDispatcher struct {
// contains filtered or unexported fields
}
TableDispatcher is a partition dispatcher which dispatches events based on the schema and table name.
func NewTableDispatcher ¶
func NewTableDispatcher() *TableDispatcher
NewTableDispatcher creates a TableDispatcher.
func (*TableDispatcher) DispatchRowChangedEvent ¶
func (t *TableDispatcher) DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) (int32, string, error)
DispatchRowChangedEvent returns the target partition to which a row changed event should be dispatched.
type TsDispatcher ¶
type TsDispatcher struct{}
TsDispatcher is a partition dispatcher which dispatch events based on ts.
func (*TsDispatcher) DispatchRowChangedEvent ¶
func (t *TsDispatcher) DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) (int32, string, error)
DispatchRowChangedEvent returns the target partition to which a row changed event should be dispatched.