topic

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKeySet = errors.New("ErrNoKeySet")
)

Functions

This section is empty.

Types

type Partition

type Partition struct {
	Id       string
	Replicas []string
	// contains filtered or unexported fields
}

func (*Partition) BatchPutMessages

func (t *Partition) BatchPutMessages(msgs []*sgproto.Message) error

func (*Partition) Close

func (p *Partition) Close() error

func (*Partition) ForRange

func (p *Partition) ForRange(min, max sandflake.ID, fn func(msg *sgproto.Message) error) error

func (*Partition) GetMessage

func (s *Partition) GetMessage(offset sandflake.ID, k, suffix []byte) (*sgproto.Message, error)

func (*Partition) HasKey

func (t *Partition) HasKey(key, clusterKey []byte) (bool, error)

func (*Partition) InitStore

func (t *Partition) InitStore(basePath string) error

func (*Partition) Iter

func (p *Partition) Iter() storage.MessageIterator

func (*Partition) LastMessage

func (p *Partition) LastMessage() (*sgproto.Message, error)

func (*Partition) LastWALEntry

func (p *Partition) LastWALEntry() []byte

func (*Partition) NextID

func (t *Partition) NextID() sandflake.ID

func (*Partition) PutMessage

func (t *Partition) PutMessage(msg *sgproto.Message) error

func (*Partition) RangeFromWAL

func (p *Partition) RangeFromWAL(min []byte, fn func(*sgproto.Message) error) error

func (*Partition) String

func (t *Partition) String() string

type Topic

type Topic struct {
	Name              string
	Kind              sgproto.TopicKind
	ReplicationFactor int
	NumPartitions     int
	Partitions        []*Partition
	StorageDriver     sgproto.StorageDriver
	// contains filtered or unexported fields
}

func (*Topic) BatchPutMessages

func (t *Topic) BatchPutMessages(msgs []*sgproto.Message) error

func (*Topic) ChoosePartition

func (t *Topic) ChoosePartition(msg *sgproto.Message) *Partition

func (*Topic) ChoosePartitionForKey

func (t *Topic) ChoosePartitionForKey(key []byte) *Partition

func (*Topic) ChooseRandomPartition added in v0.1.7

func (t *Topic) ChooseRandomPartition() *Partition

func (*Topic) Close

func (t *Topic) Close() error

func (*Topic) ForEach

func (t *Topic) ForEach(fn func(msg *sgproto.Message) error) error

func (*Topic) ForRange

func (t *Topic) ForRange(min, max sandflake.ID, fn func(msg *sgproto.Message) error) error

func (*Topic) GetPartition

func (t *Topic) GetPartition(id string) *Partition

func (*Topic) InitStore

func (t *Topic) InitStore(basePath string) error

func (*Topic) ListPartitions

func (t *Topic) ListPartitions() []*Partition

func (*Topic) PutMessage

func (t *Topic) PutMessage(partition string, msg *sgproto.Message) error

func (*Topic) Validate

func (t *Topic) Validate() error

Jump to

Keyboard shortcuts

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