Versions in this module Expand all Collapse all v1 v1.1.0 Aug 14, 2018 Changes in this version + var ErrInvalidKafkaConfigType = errors.New("Invalid Kafka config type") + func BrokerStringToSlice(s string) []int + func WhatChanged(s1 []int, s2 []int) string + func WriteMap(pm *PartitionMap, path string) error + type Broker struct + ID int + Locality string + Missing bool + New bool + Replace bool + StorageFree float64 + Used int + type BrokerMap map[int]*Broker + func BrokerMapFromPartitionMap(pm *PartitionMap, bm BrokerMetaMap, force bool) BrokerMap + func (b BrokerMap) Copy() BrokerMap + func (b BrokerMap) MappedBrokers(pm *PartitionMap) BrokerMap + func (b BrokerMap) NonReplacedBrokers() BrokerMap + func (b BrokerMap) StorageDiff(b2 BrokerMap) map[int][2]float64 + func (b BrokerMap) StorageRangeSpread() float64 + func (b BrokerMap) StorageStdDev() float64 + func (b BrokerMap) SubStorageAll(pm *PartitionMap, pmm PartitionMetaMap) error + func (b BrokerMap) SubStorageReplacements(pm *PartitionMap, pmm PartitionMetaMap) error + func (b BrokerMap) SubstitutionAffinities(pm *PartitionMap) (SubstitutionAffinities, error) + func (b BrokerMap) Update(bl []int, bm BrokerMetaMap) *BrokerStatus + type BrokerMeta struct + MetricsIncomplete bool + Rack string + StorageFree float64 + type BrokerMetaMap map[int]*BrokerMeta + type BrokerMetrics struct + StorageFree float64 + type BrokerMetricsMap map[int]*BrokerMetrics + type BrokerStatus struct + Missing int + New int + OldMissing int + Replace int + func (bs BrokerStatus) Changes() bool + type BrokerUseStats struct + Follower int + ID int + Leader int + type BrokerUseStatsList []*BrokerUseStats + func (b BrokerUseStatsList) Len() int + func (b BrokerUseStatsList) Less(i, j int) bool + func (b BrokerUseStatsList) Swap(i, j int) + type Config struct + Connect string + MetricsPrefix string + Prefix string + type DegreeDistribution struct + Relationships map[int]map[int]struct{} + func NewDegreeDistribution() DegreeDistribution + func (dd DegreeDistribution) Add(nodes []int) + func (dd DegreeDistribution) Count(n int) int + func (dd DegreeDistribution) Stats() DegreeDistributionStats + type DegreeDistributionStats struct + Avg float64 + Max float64 + Min float64 + type ErrNoNode struct + func (e ErrNoNode) Error() string + type Handler interface + Children func(string) ([]string, error) + Close func() + Create func(string, string) error + CreateSequential func(string, string) error + Exists func(string) (bool, error) + Get func(string) ([]byte, error) + GetAllBrokerMeta func(bool) (BrokerMetaMap, []error) + GetAllPartitionMeta func() (PartitionMetaMap, error) + GetPartitionMap func(string) (*PartitionMap, error) + GetReassignments func() Reassignments + GetTopicConfig func(string) (*TopicConfig, error) + GetTopicState func(string) (*TopicState, error) + GetTopicStateISR func(string) (TopicStateISR, error) + GetTopics func([]*regexp.Regexp) ([]string, error) + Set func(string, string) error + UpdateKafkaConfig func(KafkaConfig) (bool, error) + func NewHandler(c *Config) (Handler, error) + type KafkaConfig struct + Configs [][2]string + Name string + Type string + type KafkaConfigData struct + Config map[string]string + Version int + func NewKafkaConfigData() KafkaConfigData + type Mock struct + func (zk *Mock) Children(a string) ([]string, error) + func (zk *Mock) Close() + func (zk *Mock) Create(a, b string) error + func (zk *Mock) CreateSequential(a, b string) error + func (zk *Mock) Exists(a string) (bool, error) + func (zk *Mock) Get(a string) ([]byte, error) + func (zk *Mock) GetAllBrokerMeta(withMetrics bool) (BrokerMetaMap, []error) + func (zk *Mock) GetAllPartitionMeta() (PartitionMetaMap, error) + func (zk *Mock) GetBrokerMetrics() (BrokerMetricsMap, error) + func (zk *Mock) GetPartitionMap(t string) (*PartitionMap, error) + func (zk *Mock) GetReassignments() Reassignments + func (zk *Mock) GetTopicConfig(t string) (*TopicConfig, error) + func (zk *Mock) GetTopicState(t string) (*TopicState, error) + func (zk *Mock) GetTopicStateISR(t string) (TopicStateISR, error) + func (zk *Mock) GetTopics(ts []*regexp.Regexp) ([]string, error) + func (zk *Mock) InitRawClient() error + func (zk *Mock) Set(a, b string) error + func (zk *Mock) UpdateKafkaConfig(c KafkaConfig) (bool, error) + type Partition struct + Partition int + Replicas []int + Topic string + type PartitionMap struct + Partitions partitionList + Version int + func NewPartitionMap() *PartitionMap + func PartitionMapFromString(s string) (*PartitionMap, error) + func PartitionMapFromZK(t []*regexp.Regexp, zk Handler) (*PartitionMap, error) + func (pm *PartitionMap) Copy() *PartitionMap + func (pm *PartitionMap) DegreeDistribution() DegreeDistribution + func (pm *PartitionMap) LocalitiesAvailable(bm BrokerMap, b *Broker) []string + func (pm *PartitionMap) Rebuild(params RebuildParams) (*PartitionMap, []string) + func (pm *PartitionMap) SetReplication(r int) + func (pm *PartitionMap) Strip() *PartitionMap + func (pm *PartitionMap) UseStats() []*BrokerUseStats + type PartitionMeta struct + Size float64 + type PartitionMetaMap map[string]map[int]*PartitionMeta + func NewPartitionMetaMap() PartitionMetaMap + func (pmm PartitionMetaMap) Size(p Partition) (float64, error) + type PartitionState struct + ControllerEpoch int + ISR []int + Leader int + LeaderEpoch int + Version int + type Reassignments map[string]map[int][]int + type RebuildParams struct + Affinities SubstitutionAffinities + BM BrokerMap + Optimization string + PMM PartitionMetaMap + Strategy string + type SubstitutionAffinities map[int]*Broker + func (sa SubstitutionAffinities) Get(id int) *Broker + type TopicConfig struct + Config map[string]string + Version int + type TopicState struct + Partitions map[string][]int + type TopicStateISR map[string]PartitionState Incompatible versions in this module v3.1.0+incompatible Jul 12, 2019 v3.0.0+incompatible Apr 18, 2019 v2.1.0+incompatible Nov 19, 2018 v2.0.0+incompatible Oct 24, 2018 Other modules containing this package github.com/DataDog/kafka-kit/v3 github.com/DataDog/kafka-kit/v4