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.
Click to show internal directories.
Click to hide internal directories.