Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Last active December 25, 2021 10:36
Show Gist options
  • Save samueleresca/840a180bc9ab4735dfb20fb274654b10 to your computer and use it in GitHub Desktop.
Save samueleresca/840a180bc9ab4735dfb20fb274654b10 to your computer and use it in GitHub Desktop.
// OptimizeType describes an optimization type
type OptimizeType string
const (
Load OptimizeType = "Load"
Network OptimizeType = "Network"
Latency OptimizeType = "Latency"
)
// StrategyOptions describes the quorum system strategy options.
type StrategyOptions struct {
// Optimize defines the target optimization.
Optimize OptimizeType
// LoadLimit defines the limit on the load limit.
LoadLimit *float64
// NetworkLimit defines the limit on the network limit.
NetworkLimit *float64
// LatencyLimit defines the limit on the latency.
LatencyLimit *float64
// ReadFraction defines the workflow distribution for the read operations.
ReadFraction Distribution
// WriteFraction defines the workflow distribution for the write operations.
WriteFraction Distribution
// F r ∈ R is F-resilient for some integer f if despite removing
// any f nodes from r, r is still a read quorum
F uint
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment