cache

package
v0.0.0-...-ac6a2c4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label means that the label comes from the label bag on the group.
	Label = Source("label")

	// Relation means that the label comes from the relation bag on the group.
	Relation = Source("relation")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source string

Source represents the source where a label comes from, it can either be the label or the relation bag.

type Store

type Store interface {
	// Find will return the group with the given name if it exists, else it will return nil.
	Find(name string) (group *placement.Group)

	// All returns all groups in the store in sorted order by name.
	All() (all []*placement.Group)

	// Search finds all groups that have a label or relation that match the given pattern. The source determines if
	// the pattern should match a label or a relation. The resulting groups will be in sorted order by name.
	Search(pattern *labels.Label, source Source) (groups []*placement.Group)

	// Reserved returns all entities that are reserved.
	Reserved() (reservations []*placement.Reservation)

	// Next returns the next entity and the group it is place on in the store. The entities are returned in the
	// following order; lexicographically in the order of the group names, and it case of ties lexicographically in
	// the order of the entity names.
	Next() (group *placement.Group, entity *placement.Entity)

	// Update will add the groups if they do not already exist - existence is checked by the group name. If the group
	// already exists it will just update it while retaining the groups reservations.
	Update(now time.Time, groups ...*placement.Group)

	// Prune will remove any expired reservations from all groups, it will also remove any expired groups.
	Prune(now time.Time, groupMaxAge, reservationMaxAge time.Duration)
}

Store will store placement groups and entities for use by a worker node.

func NewStore

func NewStore() Store

NewStore will create a new store.

Jump to

Keyboard shortcuts

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