clustering

package
v0.0.0-...-01eed89 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DispatchMasters

func DispatchMasters(cluster *redisutil.Cluster, nodes redisutil.Nodes, nbMaster int32) (redisutil.Nodes, redisutil.Nodes, redisutil.Nodes, error)

DispatchMasters used to select nodes with master roles

func PlaceMasters

func PlaceMasters(cluster *redisutil.Cluster, currentMaster redisutil.Nodes, allPossibleMasters redisutil.Nodes, nbMaster int32) (redisutil.Nodes, bool, error)

PlaceMasters used to select Redis Node knowing on which VM they are running in order to spread as possible the masters on different VMs. Improvement: Use Kube Node labeling instead of the "NodeName", (availability zone and so)

func PlaceSlaves

func PlaceSlaves(cluster *redisutil.Cluster, masters, oldSlaves, newSlaves redisutil.Nodes, replicationFactor int32) (map[string]redisutil.Nodes, bool)

PlaceSlaves used to select Redis Node knowing on which VM they are running in order to spread as possible

Types

type Ctx

type Ctx struct {
	// contains filtered or unexported fields
}

func NewCtx

func NewCtx(cluster *redisutil.Cluster, nodes redisutil.Nodes, masterNum int32, clusterName string, log logr.Logger) *Ctx

func (*Ctx) AllocSlots

func (c *Ctx) AllocSlots(admin redisutil.IAdmin, newMasterNodes redisutil.Nodes) error

func (*Ctx) AttachingSlavesToMaster

func (c *Ctx) AttachingSlavesToMaster(admin redisutil.IAdmin) error

AttachingSlavesToMaster used to attach slaves to there masters

func (*Ctx) DispatchMasters

func (c *Ctx) DispatchMasters() error

func (*Ctx) DispatchSlotToNewMasters

func (c *Ctx) DispatchSlotToNewMasters(admin redisutil.IAdmin, newMasterNodes, currentMasterNodes, allMasterNodes redisutil.Nodes) error

DispatchSlotToNewMasters used to dispatch Slot to the new master nodes

func (*Ctx) GetCurrentMasters

func (c *Ctx) GetCurrentMasters() redisutil.Nodes

func (*Ctx) GetNewMasters

func (c *Ctx) GetNewMasters() redisutil.Nodes

func (*Ctx) GetSlaves

func (c *Ctx) GetSlaves() map[string]redisutil.Nodes

func (*Ctx) GetStatefulsetNodes

func (c *Ctx) GetStatefulsetNodes() map[string]redisutil.Nodes

func (*Ctx) PlaceMasters

func (c *Ctx) PlaceMasters(ssName string) *redisutil.Node

func (*Ctx) PlaceSlaves

func (c *Ctx) PlaceSlaves() error

func (*Ctx) RebalancedCluster

func (c *Ctx) RebalancedCluster(admin redisutil.IAdmin, newMasterNodes redisutil.Nodes) error

RebalancedCluster rebalanced a redis cluster.

type MovedNode

type MovedNode struct {
	Source *redisutil.Node
	Slot   redisutil.Slot
}

Jump to

Keyboard shortcuts

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