throttlestore

package
v3.18.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoOverrideSet = errors.New("no override set at path")
)

Functions

func RemoveThrottleOverride

func RemoveThrottleOverride(zk kafkazk.Handler, p string) error

removeThrottleOverride deletes an override at path p.

func StoreThrottleOverride

func StoreThrottleOverride(zk kafkazk.Handler, p string, c ThrottleOverrideConfig) error

storeThrottleOverride sets a throttle override to path p.

Types

type BrokerOverrides

type BrokerOverrides map[int]BrokerThrottleOverride

BrokerOverrides is a map of broker ID to BrokerThrottleOverride.

func FetchBrokerOverrides

func FetchBrokerOverrides(zk kafkazk.Handler, p string) (BrokerOverrides, error)

FetchBrokerOverrides returns a BrokerOverrides populated with all brokers with overrides set. This function exists as a convenience since the number of broker overrides can vary, as opposed to the global which has a single, consistent znode that always exists.

func (BrokerOverrides) Filter

Filter takes a BrokerOverridesFilterFn and returns a BrokerOverrides where all elements return true as an input to the filter func.

func (BrokerOverrides) IDs

func (b BrokerOverrides) IDs() []int

IDs returns a []int of broker IDs held by the BrokerOverrides.

type BrokerOverridesFilterFn

type BrokerOverridesFilterFn func(BrokerThrottleOverride) bool

BrokerOverridesFilterFn specifies a filter function.

type BrokerThrottleOverride

type BrokerThrottleOverride struct {
	// Broker ID.
	ID int
	// Whether this override is for a broker that's part of a reassignment.
	ReassignmentParticipant bool
	// The ThrottleOverrideConfig.
	Config ThrottleOverrideConfig
}

BrokerThrottleOverride holds broker-specific overrides.

func (BrokerThrottleOverride) Copy

Copy returns a copy of a BrokerThrottleOverride.

type ThrottleOverrideConfig

type ThrottleOverrideConfig struct {
	// Rate in MB.
	Rate int `json:"rate"`
	// Whether the override rate should be
	// removed when the current reassignments finish.
	AutoRemove bool `json:"autoremove"`
}

ThrottleOverrideConfig holds throttle override configurations.

func FetchThrottleOverride

func FetchThrottleOverride(zk kafkazk.Handler, p string) (*ThrottleOverrideConfig, error)

fetchThrottleOverride gets a throttle override from path p.

Jump to

Keyboard shortcuts

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