Skip to content

Commit

Permalink
use table dispatcher as the default.
Browse files Browse the repository at this point in the history
  • Loading branch information
3AceShowHand committed Aug 31, 2023
1 parent 10d4b36 commit 74bbe98
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cdc/sink/dmlsink/mq/dispatcher/partition/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,17 @@ import (
// DefaultDispatcher is the default partition dispatcher.
type DefaultDispatcher struct {
tbd *TableDispatcher
ivd *IndexValueDispatcher
}

// NewDefaultDispatcher creates a DefaultDispatcher.
func NewDefaultDispatcher() *DefaultDispatcher {
return &DefaultDispatcher{
tbd: NewTableDispatcher(),
ivd: NewIndexValueDispatcher(),
}
}

// DispatchRowChangedEvent returns the target partition to which
// a row changed event should be dispatched.
func (d *DefaultDispatcher) DispatchRowChangedEvent(row *model.RowChangedEvent, partitionNum int32) int32 {
if len(row.IndexColumns) != 1 {
return d.tbd.DispatchRowChangedEvent(row, partitionNum)
}
return d.ivd.DispatchRowChangedEvent(row, partitionNum)
return d.tbd.DispatchRowChangedEvent(row, partitionNum)
}

0 comments on commit 74bbe98

Please sign in to comment.