Documentation
¶
Index ¶
- Variables
- type KeyValue
- type Stats
- type Syncer
- func (s *Syncer) ApplyChanges(changes <-chan diff.Change, send func(KeyValue), stats *Stats, ...)
- func (s *Syncer) IndexTopic(kafka sarama.Client, index diff.Index) (msgCount uint64, err error)
- func (s *Syncer) SetupProducer(kafka sarama.Client, stats *Stats) (send func(KeyValue), finish func())
- func (s Syncer) Sync(kafka sarama.Client, kvSource <-chan KeyValue, cancel <-chan bool) (stats *Stats, err error)
- func (s Syncer) SyncWithIndex(kafka sarama.Client, kvSource <-chan KeyValue, topicIndex diff.Index, ...) (stats *Stats, err error)
- func (s Syncer) SyncWithPrepopulatedIndex(kafka sarama.Client, kvSource <-chan KeyValue, topicIndex diff.Index, ...) (stats *Stats, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
Functions ¶
This section is empty.
Types ¶
type Stats ¶
type Stats struct { // Diff statistics Created uint64 Modified uint64 Deleted uint64 Unchanged uint64 // Producer statistics SendCount uint64 SuccessCount int64 ErrorCount int64 // The count of defined key values. Count uint64 // Performance statistics MessagesInTopic uint64 ReadTopicDuration time.Duration SyncDuration time.Duration TotalDuration time.Duration // contains filtered or unexported fields }
type Syncer ¶
type Syncer struct { // The topic to synchronize. Topic string // The topic's partition to synchronize. Partition int32 // The value to use when a key is removed. RemovedValue []byte // Don't really send messages DryRun bool }
func (*Syncer) ApplyChanges ¶
func (*Syncer) IndexTopic ¶
func (*Syncer) SetupProducer ¶
func (Syncer) Sync ¶
func (s Syncer) Sync(kafka sarama.Client, kvSource <-chan KeyValue, cancel <-chan bool) (stats *Stats, err error)
Sync synchronize a key-indexed data source with a topic.
The kvSource channel provides values in the reference store. It MUST NOT produce duplicate keys.
func (Syncer) SyncWithIndex ¶
func (s Syncer) SyncWithIndex(kafka sarama.Client, kvSource <-chan KeyValue, topicIndex diff.Index, cancel <-chan bool) (stats *Stats, err error)
SyncWithIndex synchronize a data source with a topic, using the given index.
The kvSource channel provides values in the reference store. It MUST NOT produce duplicate keys.
Click to show internal directories.
Click to hide internal directories.