4.8 Module classy_partition

This module contains various algorithms for calculating network partitions.

4.8.1 Types

partition()
-type partition() :: ordsets:ordset({classy:site(),
                                     node()}).

4.8.2 Functions

full_meshes(ClusterInfo)
-spec
     full_meshes(classy:cluster_info()) -> #{classy:cluster_id()
                                                 => [partition()]}.

This greedy algorithm finds full meshes in the network. Each site appears in exactly one full mesh.

Note: because of that property, this function returns ambiguous results when network partitions are overlapping. More specifically, it will be overly eager in detecting partitions, and will ignore some existing links.

bidi_link(ClusterInfo, NodeA, NodeB)
-spec bidi_link(classy:cluster_info(), node(),
                node()) -> {ok, boolean()} | {error, _}.

Return {ok, true} if nodes are mutually connected to each other, or {ok, false} when either node considers the other disconnected.

If either node is absent in the ClusterInfo, then an error tuple is returned.

unid_link(ClusterInfo, NodeA, NodeB)
-spec unid_link(classy:cluster_info(), node(),
                node()) -> {ok, boolean()} | {error, _}.

Return {ok, Value} if node A is alive and appears in ClusterInfo. Then the value indicates whether A is currently connected to B.

Error tuple is returned if A is unreachable.


JavaScript license information