balancer

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

New builds a Balancer from the environment, sizing its per-partition bookkeeping from the configured partition count.

func (*Balancer) BalanceEagerly

func (x *Balancer) BalanceEagerly()

BalanceEagerly runs a full balance cycle right away. It is registered as the routing table callback when EnableProactiveSyncOnJoin is set, and then runs on every member after each installed routing table and, on the coordinator, after a node-join push, so the proactive primary-to-backup push starts as soon as a table is installed instead of on the next tick. The push itself runs on every cycle, once per partition per installed table as soon as the partition holds data, see pushedSignature, and holds the fragment write-lock for the duration of the network transfer, which blocks concurrent reads of that fragment; that cost is why the flag is opt-in.

func (*Balancer) RegisterHandlers

func (b *Balancer) RegisterHandlers()

func (*Balancer) Shutdown

func (b *Balancer) Shutdown(ctx context.Context) error

func (*Balancer) Start

func (b *Balancer) Start() error

type SyncState added in v0.3.8

type SyncState interface {
	PendingEmpty() bool
}

SyncState is the minimal interface for sync completion tracking.

Jump to

Keyboard shortcuts

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