admin

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolVer1 = 1 // Supported by Kafka v0.8.2 and later
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrInvalidParam

type ErrInvalidParam error

type PartitionMetadata added in v0.14.0

type PartitionMetadata struct {
	ID       int32
	Leader   int32
	Replicas []int32
	ISR      []int32
}

type PartitionOffset

type PartitionOffset struct {
	Partition int32
	Begin     int64
	End       int64
	Offset    int64
	Metadata  string
}

type T

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

T provides methods to perform administrative operations on a Kafka cluster.

func Spawn

func Spawn(parentActDesc *actor.Descriptor, cfg *config.Proxy) (*T, error)

Spawn creates an admin instance with the specified configuration and starts internal goroutines to support its operation.

func (*T) GetAllTopicConsumers

func (a *T) GetAllTopicConsumers(topic string) (map[string]map[string][]int32, error)

GetAllTopicConsumers returns group -> client-id -> consumed-partitions-list mapping for a particular topic. Warning, the function performs scan of all consumer groups registered in ZooKeeper and therefore can take a lot of time.

func (*T) GetGroupOffsets

func (a *T) GetGroupOffsets(group, topic string) ([]PartitionOffset, error)

GetGroupOffsets for every partition of the specified topic it returns the current offset range along with the latest offset and metadata committed by the specified consumer group.

func (*T) GetTopicConsumers

func (a *T) GetTopicConsumers(group, topic string) (map[string][]int32, error)

GetTopicConsumers returns client-id -> consumed-partitions-list mapping for a clients from a particular consumer group and a particular topic.

func (*T) GetTopicMetadata added in v0.14.0

func (a *T) GetTopicMetadata(topic string, withPartitions, withConfig bool) (TopicMetadata, error)

GetTopicMetadata returns a topic metadata. An optional partition metadata can be requested and/or detailed topic configuration can be requested.

func (*T) ListTopics added in v0.14.0

func (a *T) ListTopics(withPartitions, withConfig bool) ([]TopicMetadata, error)

ListTopics returns a list of all topics existing in the Kafka cluster.

func (*T) ResetKafkaClt added in v0.14.0

func (a *T) ResetKafkaClt()

func (*T) SetGroupOffsets

func (a *T) SetGroupOffsets(group, topic string, offsets []PartitionOffset) error

SetGroupOffsets commits specific offset values along with metadata for a list of partitions of a particular topic on behalf of the specified group.

func (*T) Stop

func (a *T) Stop()

Stop gracefully terminates internal goroutines.

type TopicConfig added in v0.14.0

type TopicConfig struct {
	Version int32             `json:"version"`
	Config  map[string]string `json:"config"`
}

type TopicMetadata added in v0.14.0

type TopicMetadata struct {
	Topic      string
	Config     *TopicConfig
	Partitions []PartitionMetadata
}

Jump to

Keyboard shortcuts

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