clustering

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 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 added in v0.2.0

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

func NewCtx added in v0.2.0

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

func (*Ctx) AllocSlots added in v0.2.0

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

func (*Ctx) AttachingSlavesToMaster added in v0.2.0

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

AttachingSlavesToMaster used to attach slaves to there masters

func (*Ctx) DispatchMasters added in v0.2.0

func (c *Ctx) DispatchMasters() error

func (*Ctx) DispatchSlotToNewMasters added in v0.2.0

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 added in v0.2.0

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

func (*Ctx) GetNewMasters added in v0.2.0

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

func (*Ctx) GetSlaves added in v0.2.0

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

func (*Ctx) GetStatefulsetNodes added in v0.2.0

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

func (*Ctx) PlaceMasters added in v0.2.0

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

func (*Ctx) PlaceSlaves added in v0.2.0

func (c *Ctx) PlaceSlaves() error

func (*Ctx) RebalancedCluster added in v0.2.0

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