Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoOverrideSet = errors.New("no override set at path")
)
Functions ¶
func RemoveThrottleOverride ¶
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 ¶
func (b BrokerOverrides) Filter(fn BrokerOverridesFilterFn) BrokerOverrides
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 ¶
func (b BrokerThrottleOverride) Copy() BrokerThrottleOverride
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.