Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Last active December 9, 2021 12:23
Show Gist options
  • Save samueleresca/621ac3cfc41482447edb8d004ac71dc1 to your computer and use it in GitHub Desktop.
Save samueleresca/621ac3cfc41482447edb8d004ac71dc1 to your computer and use it in GitHub Desktop.
// QuorumSystem describes a read-write quorum system.
type QuorumSystem struct {
// reads describes the read-quorum.
reads Expr
// writes describes the write-quorum.
writes Expr
// nameToNode keeps track the name of a node to a GetNodeByName.
nameToNode nameToNode
}
// Capacity calculate and gets the capacity from the optimized Strategy.
func (qs QuorumSystem) Capacity(strategyOptions StrategyOptions) (float64, error) {
...
}
// Latency calculate and gets the latency from the optimized Strategy.
func (qs QuorumSystem) Latency(strategyOptions StrategyOptions) (float64, error) {
...
}
// Load calculate and gets the Load from the optimized Strategy.
func (qs QuorumSystem) Load(strategyOptions StrategyOptions) (float64, error) {
...
}
// NetworkLoad calculate and gets the NetworkLoad from the optimized Strategy.
func (qs QuorumSystem) NetworkLoad(strategyOptions StrategyOptions) (float64, error) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment