kafka

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Alive bool
)

client variables

View Source
var (

	// FORCE bypasses any configured checks.
	FORCE bool
)

Functions

func Client

func Client() *kafkactl.KClient

Client returns the kafkactl client.

func ClientVersion

func ClientVersion() sarama.KafkaVersion

ClientVersion returns the kafkactl client.

func CloseClient

func CloseClient()

func ClusterDetails

func ClusterDetails()

ClusterDetails prints details for the current context.

func ConfigurePartitionCount

func ConfigurePartitionCount(flags OpsCreateFlags, topics ...string)

func CreateTopics

func CreateTopics(partitions int32, rFactor int16, topics ...string)

func DeleteGroups

func DeleteGroups(groups ...string)

func DeleteTopics

func DeleteTopics(topics ...string)

func FilterTOMByLeader

func FilterTOMByLeader(tom []kafkactl.TopicOffsetMap, leaders []int32) []kafkactl.TopicOffsetMap

func FollowTopic

func FollowTopic(flags MSGFlags, outFlags out.OutFlags, topics ...string)

func GetBrokerMetrics

func GetBrokerMetrics(intervals, seconds int) kafkactl.MetricCollection

GetBrokerMetrics return broker related metrics.

func GetGOM

func GetGOM(group string, topics ...string) []kafkactl.GroupOffsetMap

func GetKakfaMetrics

func GetKakfaMetrics(flags MetricFlags) kafkactl.MetricCollection

func GetMessages

func GetMessages(flags MSGFlags, topics ...string) []*kafkactl.Message

GetMessages returns messages from a kafka topic

func GetTopicOffsetMap

func GetTopicOffsetMap(tm []kafkactl.TopicMeta) []kafkactl.TopicOffsetMap

func GroupMetaByMember

func GroupMetaByMember(members ...string) []kafkactl.GroupMeta

func GroupMetaByTopics

func GroupMetaByTopics(topics ...string) []kafkactl.GroupMeta

func LaunchClient

func LaunchClient(context *cx.Context, flags ClientFlags)

func MetaData

func MetaData() kafkactl.ClusterMeta

func MetricR

func MetricR() *metrics.Registry

MetricR returns the kafkactl metrics registry.

func ParseTopicStdin

func ParseTopicStdin(r io.Reader) []topicStdinData

ParseTopicStdin parses Stdin passed from kafkactl topic metadata

func PrintAdm

func PrintAdm(i interface{})

func PrintMSG

func PrintMSG(msg *kafkactl.Message, outFlags out.OutFlags)

PrintMSG returns messages displayed by the desired format while following a topic.

func PrintMSGs

func PrintMSGs(msgs []*kafkactl.Message, outFlags out.OutFlags)

func PrintMetricCollection

func PrintMetricCollection(MC kafkactl.MetricCollection)

func PrintMetrics

func PrintMetrics(i interface{})

func PrintOut

func PrintOut(i interface{})

func ProduceFromFile

func ProduceFromFile(flags SendFlags, data io.Reader, topics ...string)

func SearchGroupListMeta

func SearchGroupListMeta(groups ...string) []kafkactl.GroupListMeta

func SearchGroupMeta

func SearchGroupMeta(group ...string) []kafkactl.GroupMeta

func SearchTOM

func SearchTOM(topics ...string) []kafkactl.TopicOffsetMap

func SearchTopicMeta

func SearchTopicMeta(topics ...string) []kafkactl.TopicMeta

func SetOffsets

func SetOffsets(flags OpsOffsetFlags, topics ...string)

func ZkCreateRAP

func ZkCreateRAP(rapList RAPartList) bool

Types

type APIVersion

type APIVersion struct {
	Name       string
	Key        int16
	MaxVersion int16
}

APIVersion describes an API Version Key and its Max Version.

func GetAPIVersions

func GetAPIVersions() []APIVersion

type Broker

type Broker struct {
	Address            string
	ID                 int32
	GroupsCoordinating int64
	LeaderReplicas     int64
	PeerReplicas       int64
	TotalReplicas      int64
	MigratingReplicas  int64
	Overload           int64
}

func GetBrokerInfo

func GetBrokerInfo(b ...string) []*Broker

type BrokerReplicas

type BrokerReplicas struct {
	BrokerID     int32
	ReplicaCount int32
}

type ClientFlags

type ClientFlags struct {
	Exact   bool
	Verbose bool
	Context string
	Version string
}

type GroupFlags

type GroupFlags struct {
	Describe bool
	Lag      bool
	Topic    bool
}

type GroupPartitionMeta

type GroupPartitionMeta struct {
	Group            string
	GroupOffset      int64
	Lag              int64
	GroupCoordinator string
}

type GroupTopicOffsetMeta

type GroupTopicOffsetMeta struct {
	TopicPartitionMeta
	GroupPartitionMeta
}

type GrpLag

type GrpLag struct {
	// contains filtered or unexported fields
}

type LagFlags

type LagFlags struct {
	Group bool
	Topic bool
}

type MSGFlags

type MSGFlags struct {
	Partitions   []string
	Partition    int32
	Offset       int64
	Tail         int64
	TailTouched  bool
	Follow       bool
	FromTime     string
	ToTime       string
	LastDuration string
	JSONFilters  []string
}

type MetricFlags

type MetricFlags struct {
	Broker    bool
	Intervals int
	Seconds   int
}

MetricFlags defines flags for reporting metrics.

type OffsetDetail

type OffsetDetail struct {
	Topic             string
	Group             string
	Partition         int32
	TopicOffsetOldest int64
	TopicOffsetNewest int64
	GroupOffset       int64
	Lag               int64
}

type OffsetDetails

type OffsetDetails struct {
	Details        []OffsetDetail
	IncludesGroups bool
}

func GetTopicOffsets

func GetTopicOffsets(topics ...string) (topicDetails OffsetDetails)

func MatchGroupOffsets

func MatchGroupOffsets(topicDetails OffsetDetails) (groupDetails OffsetDetails)

type OffsetRangeMap added in v1.0.24

type OffsetRangeMap struct {
	Ranges map[string]map[int32][2]int64
}

OffsetRangeMap contains Topics and a Range of Offsets specified from a beginning and end.

func GetMsgOffsets added in v1.0.24

func GetMsgOffsets(flags MSGFlags, topics ...string) OffsetRangeMap

GetMsgOffsets returns offsets for the given topics queried by time.

type OpsCreateFlags

type OpsCreateFlags struct {
	DryRun            bool
	PartitionCount    int32
	ReplicationFactor int16
}

type OpsOffsetFlags

type OpsOffsetFlags struct {
	AllParts       bool
	OffsetNewest   bool
	OffsetOldest   bool
	ShowGroups     bool
	Delete         bool
	Group          string
	Partitions     []int32
	Offset         int64
	RelativeOffset int64
}

type OpsReplicaFlags

type OpsReplicaFlags struct {
	DryRun            bool
	AllParts          bool
	PreserveLeader    bool
	Brokers           []int32
	Partitions        []int32
	ReplicationFactor int
}

type PREFlags

type PREFlags struct {
	AllTopics  bool
	Partition  int32
	Partitions []string
}

type PREList

type PREList struct {
	Version    int            `json:"version"`
	Partitions []PREPartition `json:"partitions"`
}

type PREPartition

type PREPartition struct {
	Topic     string `json:"topic"`
	Partition int32  `json:"partition"`
}

type PRESummary

type PRESummary struct {
	Topics   []string
	PRECount map[string]uint32
}

type PRETopicMeta

type PRETopicMeta struct {
	Partitions []kafkactl.TopicMeta
}

func GetPREMeta

func GetPREMeta(topics ...string) PRETopicMeta

func PerformTopicPRE

func PerformTopicPRE(topics ...string) PRETopicMeta

func (PRETopicMeta) CreatePREList

func (pre PRETopicMeta) CreatePREList() PREList

func (PRETopicMeta) CreatePRESummary

func (pre PRETopicMeta) CreatePRESummary() PRESummary

type PartitionLag

type PartitionLag struct {
	Group     string
	Topic     string
	Partition int32
	Host      string
	Member    string
	Offset    int64
	Lag       int64
}

PartitionLag struct def:

func FindPartitionLag

func FindPartitionLag() []PartitionLag

func GetGroupLag

func GetGroupLag(grpMeta []kafkactl.GroupMeta) []PartitionLag

type RAPartList

type RAPartList struct {
	Version    int           `json:"version"`
	Partitions []RAPartition `json:"partitions"`
}

func MovePartitionsStdin

func MovePartitionsStdin(moveData []topicStdinData, brokers []int32) RAPartList

func RebalanceTopics

func RebalanceTopics(flags OpsReplicaFlags, topics ...string) RAPartList

func SetTopicReplicas

func SetTopicReplicas(flags OpsReplicaFlags, topics ...string) RAPartList

type RAPartition

type RAPartition struct {
	Topic     string  `json:"topic"`
	Partition int32   `json:"partition"`
	Replicas  []int32 `json:"replicas"`
}

type ReplicaDetails

type ReplicaDetails struct {
	TopicMetadata []kafkactl.TopicMeta
}

func GetTopicReplicas

func GetTopicReplicas(topics ...string) ReplicaDetails

type SendFlags

type SendFlags struct {
	Key           string
	Value         string
	Delimiter     string
	DelimiterUsed bool
	Partitions    []string
	Partition     int32
	AllPartitions bool
	FromStdin     bool
	NoSplit       bool
	LineSplit     string
}

type TopicConfig

type TopicConfig struct {
	Topic     string
	Config    string
	Value     string
	ReadOnly  bool
	Default   bool
	Sensitive bool
}

TopicConfig struct def:

func GetNonDefaultConfigs

func GetNonDefaultConfigs(configs []TopicConfig) []TopicConfig

GetNonDefaultConfigs returns Topic Configs that have been altered.

func GetTopicConfigs

func GetTopicConfigs(configs []string, topics ...string) []TopicConfig

GetTopicConfigs creates and returns Topic Configs.

func SearchTopicConfigs

func SearchTopicConfigs(configs []string, topics ...string) []TopicConfig

SearchTopicConfigs searches and returns Topic Configs.

func SetDefaultConfig

func SetDefaultConfig(config string, topics ...string) []TopicConfig

SetDefaultConfig sets the configuration for a Topic back to defaults.

func SetTopicConfig

func SetTopicConfig(config, value string, topics ...string) []TopicConfig

SetTopicConfig sets a parameter for a Topic.

type TopicConfigFlags

type TopicConfigFlags struct {
	Config         string
	Value          string
	Configs        []string
	GetNonDefaults bool
	SetDefault     bool
}

TopicConfigFlags .

type TopicFlags

type TopicFlags struct {
	FindPRE  bool
	Describe bool
	Group    bool
	Lag      bool
	Leaders  []int32
}

type TopicPartitionMeta

type TopicPartitionMeta struct {
	Topic       string
	Partition   int32
	TopicOffset int64
	TopicLeader int32
}

type TotalLag

type TotalLag struct {
	Group    string
	Topic    string
	TotalLag int64
}

TotalLag struct def:

func FindTotalLag

func FindTotalLag() []TotalLag

Jump to

Keyboard shortcuts

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