Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct { MaxBatchCount int // contains filtered or unexported fields }
Buffer holds records and answers questions on when it should be periodically flushed.
func (*Buffer) FirstSeq ¶
FirstSequenceNumber returns the sequence number of the first record in the buffer.
func (*Buffer) Flush ¶
func (b *Buffer) Flush()
Flush empties the buffer and resets the sequence counter.
func (*Buffer) GetRecords ¶
GetRecords returns the records in the buffer.
func (*Buffer) ShouldFlush ¶
ShouldFlush determines if the buffer has reached its target size.
type Checkpoint ¶
type Checkpoint struct { AppName string StreamName string // contains filtered or unexported fields }
RedisCheckpoint implements the Checkpont interface. This class is used to enable the Pipeline.ProcessShard to checkpoint their progress.
func (*Checkpoint) CheckpointExists ¶
func (c *Checkpoint) CheckpointExists(shardID string) bool
CheckpointExists determines if a checkpoint for a particular Shard exists. Typically used to determine whether we should start processing the shard with TRIM_HORIZON or AFTER_SEQUENCE_NUMBER (if checkpoint exists).
func (*Checkpoint) SequenceNumber ¶
func (c *Checkpoint) SequenceNumber() string
SequenceNumber returns the current checkpoint stored for the specified shard.
func (*Checkpoint) SetCheckpoint ¶
func (c *Checkpoint) SetCheckpoint(shardID string, sequenceNumber string)
SetCheckpoint stores a checkpoint for a shard (e.g. sequence number of last record processed by application). Upon failover, record processing is resumed from this point.
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
NewConsumer creates a new kinesis connection and returns a new consumer initialized with app and stream name
type HandlerFunc ¶
type HandlerFunc func(b Buffer)
HandlerFunc is a convenience type to avoid having to declare a struct to implement the Handler interface, it can be used like this:
consumer.AddHandler(connector.HandlerFunc(func(b Buffer) { // ... }))
func (HandlerFunc) HandleRecords ¶
func (h HandlerFunc) HandleRecords(b Buffer)
HandleRecords implements the Handler interface