Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcPriorityForAgent ¶
func CalcPriorityForAgent( agent *topo.AgentStat, cfgPrio config.Priority, coeffRules map[string]float64, ) float64
CalcPriorityForAgent calculates priority for the specified agent.
func CalcPriorityForNode ¶
CalcPriorityForNode returns implicit priority based on node info.
Types ¶
type NodesPriority ¶
type NodesPriority struct {
// contains filtered or unexported fields
}
NodesPriority groups nodes by priority according to provided scores. Basically nodes are grouped and sorted by descending order by score
func CalcNodesPriority ¶
func CalcNodesPriority( c map[string]float64, cfgPrio config.Priority, agents []topo.AgentStat, ) *NodesPriority
CalcNodesPriority calculates and returns list nodes grouped by backup/pitr preferences in descended order. First are nodes with the highest priority. Custom coefficients might be passed. These will be ignored though if the config is set.
func NewNodesPriority ¶
func NewNodesPriority() *NodesPriority
func (*NodesPriority) Add ¶
func (n *NodesPriority) Add(rs, node string, sc float64)
Add node with its score
func (*NodesPriority) RS ¶
func (n *NodesPriority) RS(rs string) [][]string
RS returns nodes `group and sort desc by score` for given replset
Click to show internal directories.
Click to hide internal directories.