partition

package
v0.0.0-...-ed33083 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Partition

type Partition struct {
	TopicName       string
	PartitionNumber int
	CommitLog       *storage.CommitLog
	// contains filtered or unexported fields
}

Partition is a partition of a topic. Each topic will consistof several partitions When a producer produces to a topic, we will pick the Partition in a load balanced manner Each consumer will only consume from one Partition Data storage will be done on a Partition level using log package all the on disk process will be done via the commit log We will always make sure the number of Partitions is more than the number of consumers one consumer can consume from two Partitions but no two consumers can consume from the same Partition

func NewPartition

func NewPartition(topicName string, partitionNumber int, brokerURI string, etcdClient *clientv3.Client) (*Partition, error)

func (*Partition) Read

func (p *Partition) Read(offset int64) (api.Message, error)

func (*Partition) Write

func (p *Partition) Write(msg api.Message) error

Jump to

Keyboard shortcuts

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