# Functions
AssignmentDiffs returns the diffs implied by the argument current and desired PartitionAssignments.
AssignmentsToReplicas is the inverse of ReplicasToAssignments.
AssignmentsToUpdate returns the subset of assignments that need to be updated given the current and desired states.
BrokerCountsPerRack returns a mapping of rack -> number of brokers.
BrokerIDs returns a slice of the IDs of the argument brokers.
BrokerRacks returns a mapping of broker ID -> rack.
BrokersPerRack returns a mapping of rack -> broker IDs.
BrokerThrottles returns a slice of BrokerThrottles that we should apply.
CheckAssignments does some basic sanity checks on the assignments that are passed into an Assigner or extender so that we can fail early if something is obviously wrong.
CopyAssignments returns a deep copy of the argument PartitionAssignment slice.
DistinctRacks returns a sorted slice of all the distinct racks in the cluster.
FollowerPartitionThrottles returns a slice of PartitionThrottles that we should apply on the follower side.
FormatAssignentDiffs generates a pretty table that shows the before and after states of a partition replica and/or leader update.
FormatBrokerMaxPartitions generates a pretty table that shows the total number of partitions that each broker is involved in for a diff.
FormatBrokerRackReplicas creates a pretty table that shows how many replicas are in each position (i.e., leader, second, third) by rack across all topics.
FormatBrokerReplicas creates a pretty table that shows how many replicas are in each position (i.e., leader, second, third) by broker across all topics.
FormatBrokers creates a pretty table from a list of brokers.
FormatBrokersPerRack creates a pretty table that shows the number of brokers per rack.
FormatConfig creates a pretty table with all of the keys and values in a topic or broker config.
FormatTopicLeadersPerRack creates a pretty table that shows the number of partitions with a leader in each rack.
FormatTopicPartitions creates a pretty table with information on all of the partitions for a topic.
FormatTopics creates a pretty table that lists the details of the argument topics.
HasLeaders returns whether at least one partition in the argument topics has a non-zero leader set.
LeaderPartitionThrottles returns a slice of PartitionThrottles that we should apply on the leader side.
LeadersPerRack returns a mapping of rack -> number of partitions with a leader in that rack.
MaxPartitionsPerBroker calculates the number of partitions that each broker may need to handle during a migration.
MaxReplication returns the maximum amount of replication across all partitions in the argument topics.
NewClient creates and returns a new Client instance.
NewLeaderPartitions returns the partition IDs which will have new leaders given the current and desired assignments.
ParseBrokerThrottles returns slices of the leader and follower throttles for the argument brokers.
ParsePartitionThrottles returns slices of the leader and follower partition throttles for the argument topic.
ParsePartitionThrottleStr converts a throttle config string from zk into a slice of PartitionThrottle structs.
PartitionIDs returns the IDs from the argument partitions.
PartitionThrottleConfigEntries generates the topic config entries for the provided leader and follower throttles.
ReplicasToAssignments converts a slice of slices to a slice of PartitionAssignments, assuming that the argument slices are in partition order.
SameBrokers returns whether two PartitionAssignments have the same brokers.
ThrottledBrokerIDs returns a slice of the IDs of the subset of argument brokers that have throttles on them.
ThrottledTopicNames returns the names of topics in the argument slice that have throttles on them.
# Constants
FollowerReplicasThrottledKey is the config key for the list of follower replicas that should be throttled.
FollowerThrottledKey is the config key for the follower throttle rate.
LeaderReplicasThrottledKey is the config key for the list of leader replicas that should be throttled.
LeaderThrottledKey is the config key for the leader throttle rate.
RetentionKey is the config key used for topic time retention.
# Variables
ErrTopicDoesNotExist is returned by admin functions when a topic that should exist does not.
# Structs
AssignmentDiff represents the diff in a single partition reassignment.
BrokerInfo represents the information stored about a broker in zookeeper.
BrokerThrottle represents a throttle being applied to a single broker.
Client is a general client for interacting with a kafka cluster.
ClientConfig contains all of the parameters necessary to create a kafka admin client.
PartitionAssignment contains the actual or desired assignment of replicas in a topic partition.
PartitionInfo represents the information stored about a topic partition in zookeeper.
PartitionThrottle represents a throttle being applied to a single partition, broker combination.
TopicInfo represents the information stored about a topic in zookeeper.