factory

package
v0.37.12-add-verify-ex... Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: AGPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterList

func NewClusterList(assignments flow.AssignmentList, collectors flow.IdentitySkeletonList) (flow.ClusterList, error)

NewClusterList creates a new cluster list based on the given cluster assignment and the provided list of identities. The implementation enforces the following protocol rules and errors in case they are violated:

(a) input `collectors` only contains collector nodes with positive weight
(b) collectors have unique node IDs
(c) each collector is assigned exactly to one cluster and is only listed once within that cluster

Furthermore, for each cluster (i.e. element in `assignments`) we enforce:

(d) cluster contains at least one collector (i.e. is not empty)
(e) cluster is composed of known nodes, i.e. for each nodeID in `assignments` an IdentitySkeleton is given in `collectors`
(f) cluster assignment lists the nodes in canonical ordering

The caller must ensure each assignment contains identities ordered in canonical order, so that each cluster in the returned cluster list is ordered in canonical order as well. If not, an error will be returned. This is a side-effect-free function. Any error return indicates that the input violate protocol rules.

Types

This section is empty.

Jump to

Keyboard shortcuts

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