Documentation ¶
Overview ¶
Package quorums is a package for initializing and maintaining the distribted mutex's quorums from the local node's perspective. It creates the quorums based on a binary tree of IP addresses (dependent on the dmutex/bintree package). The package also exposes a function to calculate and return substitute paths for a failed node in the quorum.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quorums ¶
type Quorums struct { MyQuorums map[int][]string Peers map[string]bool NumPeers int // contains filtered or unexported fields }
Quorums type builds and maintains the cluster quorums using the bintree package to maintain the tree.
func NewQuorums ¶
NewQuorums initializes the quorums from the local node's perspective based on a bintree of IP addresses and the local address.
func (*Quorums) SubstitutePaths ¶
SubstitutePaths returns possible paths starting from the site’s two children and ending in leaf node. Used in the distributed mutex algorithm when a node in the quorum has failed.