placement

package
v2.1.9+incompatible Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Constraints []*Constraint
}

Config is consist of a list of constraints.

func ParseConfig

func ParseConfig(str string) (*Config, error)

ParseConfig parses a user configuration string.

type Constraint

type Constraint struct {
	Function string   // One of "count", "label_values", "count_leader", "isolation_level".
	Filters  []Filter // "key:value" formed parameters.
	Labels   []string // "key" formed parameters.
	Op       string   // One of "<", "<=", "=", ">=", ">".
	Value    int      // Expected expression evaluate value.
}

Constraint represents a user-defined region placement rule. Each constraint is configured as an expression, for example 'count(zone:z1,rack:r1,host)>=3'.

type Filter

type Filter struct {
	Key, Value string
}

Filter is used for filtering replicas of a region. The form in the configuration is "key:value", which appears in the function argument of the expression.

Jump to

Keyboard shortcuts

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