sharder

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerName = "sharder"

ControllerName is the name of this controller.

Variables

View Source
var (
	// KeyForObject is an alias for key.ForObject, exposed for testing.
	KeyForObject = key.ForObject
	// KeyForController is an alias for key.ForController, exposed for testing.
	KeyForController = key.ForController
)

Functions

This section is empty.

Types

type Operation added in v0.10.0

type Operation struct {
	Client client.Client
	Reader client.Reader

	ControllerRing *shardingv1alpha1.ControllerRing
	Namespaces     sets.Set[string]
	HashRing       *consistenthash.Ring
	Shards         leases.Shards
}

func (*Operation) ResyncControllerRing added in v0.10.0

func (o *Operation) ResyncControllerRing(ctx context.Context, log logr.Logger) error

type Reconciler

type Reconciler struct {
	Client client.Client
	Reader client.Reader
	Clock  clock.PassiveClock
	Config *configv1alpha1.SharderConfig
}

Reconciler reconciles ControllerRings.

func (*Reconciler) AddToManager

func (r *Reconciler) AddToManager(mgr manager.Manager) error

AddToManager adds Reconciler to the given manager.

func (*Reconciler) GetSelectedNamespaces added in v0.10.0

func (r *Reconciler) GetSelectedNamespaces(ctx context.Context, controllerRing *shardingv1alpha1.ControllerRing) (sets.Set[string], error)

func (*Reconciler) LeasePredicate

func (r *Reconciler) LeasePredicate() predicate.Predicate

func (*Reconciler) NewOperation added in v0.10.0

func (r *Reconciler) NewOperation(ctx context.Context, controllerRing *shardingv1alpha1.ControllerRing) (*Operation, error)

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile reconciles a ControllerRing object.

Jump to

Keyboard shortcuts

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