replicas

package
v0.0.127 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkSlice added in v0.0.114

func ChunkSlice(slice []uint64, numChunks int) [][]uint64

func Specific

func Specific(replicasWanted uint64, existingIndexes []uint64, nodes []uint64, member uint64) ([]uint64, []uint64)

func Uniform

func Uniform(replicasWanted uint64, existingIndexes []uint64, cluster []uint64, member uint64) ([]uint64, []uint64)

Types

type Distributed added in v0.0.81

type Distributed struct {
	Group    string
	Name     string
	Spread   string
	Replicas map[uint64]*Replicas
}

type Replicas

type Replicas struct {
	NodeID  uint64
	Create  []uint64
	Destroy []uint64
	Cluster []uint64
}

func New added in v0.0.114

func New(nodeID uint64, nodes []*node.Node) *Replicas

func (*Replicas) GenerateContainers added in v0.0.114

func (replicas *Replicas) GenerateContainers(registry *registry.Registry, definition *v1.ContainerDefinition, config *configuration.Configuration) ([]platforms.IContainer, []platforms.IContainer, error)

func (*Replicas) GetContainersIndexes added in v0.0.114

func (replicas *Replicas) GetContainersIndexes(registry *registry.Registry, definition *v1.ContainerDefinition) ([]uint64, []uint64)

func (*Replicas) GetReplicaNumbers

func (replicas *Replicas) GetReplicaNumbers(spread v1.ContainerSpread, replicasDefined uint64, existingIndexes []uint64) ([]uint64, []uint64)

func (*Replicas) Recalculate added in v0.0.114

func (replicas *Replicas) Recalculate(spread v1.ContainerSpread, replicasDefined uint64, existingIndexes []uint64)

func (*Replicas) RemoveContainers added in v0.0.114

func (replicas *Replicas) RemoveContainers(registry *registry.Registry, definition *v1.ContainerDefinition) ([]platforms.IContainer, error)

Jump to

Keyboard shortcuts

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