quorums

package
v0.0.0-...-3e94386 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 2 Imported by: 5

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

func NewQuorums(t *bintree.Tree, localAddr string) *Quorums

NewQuorums initializes the quorums from the local node's perspective based on a bintree of IP addresses and the local address.

func (*Quorums) SubstitutePaths

func (q *Quorums) SubstitutePaths(node string) [][]string

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.

Jump to

Keyboard shortcuts

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