sticky

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package sticky provides sticky partitioning strategy for Kafka, with a complete overhaul to be faster, more understandable, and optimal.

For some points on how Java's strategy is flawed, see https://github.com/Shopify/sarama/pull/1416/files/b29086bdaae0da7ce71eae3f854d50685fd6b631#r315005878

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupMember

type GroupMember struct {
	ID       string
	Topics   []string
	UserData []byte
}

GroupMember is a Kafka group member.

type Plan

type Plan map[string]map[string][]int32

Plan is the plan this package came up with (member => topic => partitions).

func Balance

func Balance(members []GroupMember, topics map[string]int32) Plan

Balance performs sticky partitioning for the given group members and topics, returning the determined plan.

Jump to

Keyboard shortcuts

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