classy_partition ¶This module contains various algorithms for calculating network partitions.
-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.
-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.
-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.