Documentation ¶
Index ¶
- func AttachReplicasToPrimary(ctx context.Context, cluster *redis.Cluster, admin redis.AdminInterface, ...) error
- func ClassifyNodesByRole(nodes redis.Nodes) (primaries, replicas, primariesWithNoSlots redis.Nodes)
- func DispatchReplica(ctx context.Context, cluster *redis.Cluster, nodes redis.Nodes, ...) error
- func DispatchSlotsToNewPrimaries(ctx context.Context, admin redis.AdminInterface, cluster *rapi.RedisCluster, ...) error
- func GeneratePrimaryToReplicas(primaries, replicas redis.Nodes, replicationFactor int32) (map[string]redis.Nodes, redis.Nodes)
- func GetZoneIndex(zones []string, primaryZone string, replicas redis.Nodes) int
- func PlacePrimaries(cluster *redis.Cluster, currentPrimaries, candidatePrimaries redis.Nodes, ...) (redis.Nodes, bool, error)
- func PlaceReplicas(cluster *redis.Cluster, primaryToReplicas map[string]redis.Nodes, ...) error
- func RemoveOldReplicas(oldReplicas, newReplicas redis.Nodes) redis.Nodes
- func SameZone(zone string, nodes redis.Nodes) bool
- func SelectPrimaries(cluster *redis.Cluster, currentPrimaries, candidatePrimaries redis.Nodes, ...) (redis.Nodes, error)
- func SelectPrimariesToReplace(oldPrimaries, newPrimaries, newNodesNoSlots redis.Nodes, ...) (redis.Nodes, redis.Nodes, error)
- func ZoneToNodes(zones []string, nodes redis.Nodes) map[string]redis.Nodes
- func ZonesBalanced(zones []string, candidate *redis.Node, nodes redis.Nodes) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachReplicasToPrimary ¶
func AttachReplicasToPrimary(ctx context.Context, cluster *redis.Cluster, admin redis.AdminInterface, primaryToReplicas map[string]redis.Nodes) error
AttachReplicasToPrimary used to attach replicas to their primaries
func ClassifyNodesByRole ¶
ClassifyNodesByRole use to classify the Nodes by roles
func DispatchReplica ¶
func DispatchReplica(ctx context.Context, cluster *redis.Cluster, nodes redis.Nodes, replicationFactor int32, admin redis.AdminInterface) error
DispatchReplica aims to dispatch the available redis to replica of the current primaries
func DispatchSlotsToNewPrimaries ¶
func DispatchSlotsToNewPrimaries(ctx context.Context, admin redis.AdminInterface, cluster *rapi.RedisCluster, rCluster *redis.Cluster, newPrimaryNodes, currentPrimaryNodes, allPrimaryNodes redis.Nodes, scaling bool) error
DispatchSlotsToNewPrimaries used to dispatch slots to the new primary nodes
func PlacePrimaries ¶
func PlacePrimaries(cluster *redis.Cluster, currentPrimaries, candidatePrimaries redis.Nodes, nbPrimary int32) (redis.Nodes, bool, error)
PlacePrimaries selects primary redis nodes by spreading out the primaries across zones as much as possible.
func PlaceReplicas ¶
func PlaceReplicas(cluster *redis.Cluster, primaryToReplicas map[string]redis.Nodes, newReplicas, unusedReplicas redis.Nodes, replicationFactor int32) error
PlaceReplicas selects replica redis nodes for each primary by spreading out the replicas across zones as much as possible.
func SelectPrimaries ¶
func SelectPrimaries(cluster *redis.Cluster, currentPrimaries, candidatePrimaries redis.Nodes, nbPrimary int32) (redis.Nodes, error)
SelectPrimaries used to select redis nodes with primary roles
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.