replicas

package
v0.0.76 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(replicasNumber uint64, existingIndexes []uint64, clusterSize uint64, member uint64) ([]uint64, []uint64, []uint64)

func Specific

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

func Uniform

func Uniform(replicasNumber uint64, existingIndexes []uint64, clusterSize uint64, member uint64) ([]uint64, []uint64, []uint64)

Types

type DistributedReplicas

type DistributedReplicas struct {
	Group    string
	Name     string
	Replicas map[uint64]*ScopedReplicas
}

func NewDistributed

func NewDistributed(nodeID uint64, group string, name string) *DistributedReplicas

func (*DistributedReplicas) Clear

func (dr *DistributedReplicas) Clear(node uint64)

func (*DistributedReplicas) FromJson

func (dr *DistributedReplicas) FromJson(data []byte) error

func (*DistributedReplicas) Load

func (dr *DistributedReplicas) Load(client *client.Client, user *authentication.User) error

func (*DistributedReplicas) Save

func (dr *DistributedReplicas) Save(client *client.Client, user *authentication.User) error

func (*DistributedReplicas) ToJson

func (dr *DistributedReplicas) ToJson() ([]byte, error)

type Numbers

type Numbers struct {
	Create   []uint64
	Destroy  []uint64
	Existing []uint64
}

type R

type R struct {
	Group string
	Name  string
}

type Replicas

type Replicas struct {
	Group           string
	GeneratedIndex  uint64
	ExistingIndexes []uint64
	Replicas        uint64
	Changed         bool
	Spread          v1.ContainerSpread
	NodeID          uint64
}

func (*Replicas) GetReplica

func (replicas *Replicas) GetReplica(shared *shared.Shared, user *authentication.User, containerDefinition v1.ContainerDefinition, clstr []string) ([]R, error)

func (*Replicas) GetReplicaNumbers

func (replicas *Replicas) GetReplicaNumbers(dr *DistributedReplicas, spread v1.ContainerSpread, replicasNumber uint64, existingIndexes []uint64, clusterSize uint64) ([]uint64, []uint64, []uint64)

func (*Replicas) HandleReplica

func (replicas *Replicas) HandleReplica(shared *shared.Shared, user *authentication.User, clstr []string, containerDefinition *v1.ContainerDefinition, changelog diff.Changelog) (*DistributedReplicas, error)

type ScopedReplicas

type ScopedReplicas struct {
	Create  []R
	Remove  []R
	Numbers Numbers
}

func NewScoped

func NewScoped() *ScopedReplicas

func (*ScopedReplicas) Add

func (sr *ScopedReplicas) Add(group string, name string)

func (*ScopedReplicas) Delete

func (sr *ScopedReplicas) Delete(group string, name string)

Jump to

Keyboard shortcuts

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