planer

package
v1.4.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Planner

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

Planner decides how many out of the given replicas should be placed in each of the federated clusters.

func NewPlanner

func NewPlanner(preferences *fed_api.FederatedReplicaSetPreferences) *Planner

func (*Planner) Plan

func (p *Planner) Plan(replicasToDistribute int64, availableClusters []string) map[string]int64

Distribute the desired number of replicas among the given cluster according to the planner preferences. The function tries its best to assign each cluster the prefered number of replicas, however if sum of MinReplicas for all cluster is bigger thant replicasToDistribute then some cluster will not have all of the replicas assigned. In such case a cluster with higher weight has priority over cluster with lower weight (or with lexicographically smaller name in case of draw).

Jump to

Keyboard shortcuts

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