config

package
v0.0.0-...-2e52d37 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimer

func GetTimer() time.Duration

func Simulation

func Simulation()

Simulation enable go channel transportation to simulate distributed environment

Types

type Bconfig

type Bconfig struct {
	T            int    // total number of running time in seconds
	N            int    // total number of requests
	K            int    // key sapce
	Throttle     int    // requests per second throttle, unused if 0
	Concurrency  int    // number of simulated clients
	Distribution string // distribution

	// conflict distribution
	Conflicts int // percentage of conflicting keys
	Min       int // min key

	// normal distribution
	Mu    float64 // mu of normal distribution
	Sigma float64 // sigma of normal distribution
	Move  bool    // moving average (mu) of normal distribution
	Speed int     // moving speed in milliseconds intervals per key
}

Bconfig holds all benchmark configuration

type Config

type Config struct {
	Addrs     map[identity.NodeID]string `json:"address"`      // address for node communication
	HTTPAddrs map[identity.NodeID]string `json:"http_address"` // address for client server communication

	Policy    string  `json:"policy"`    // leader change policy {consecutive, majority}
	Threshold float64 `json:"threshold"` // threshold for policy in WPaxos {n consecutive or time interval in ms}

	Thrifty        bool            `json:"thrifty"`          // only send messages to a quorum
	BufferSize     int             `json:"buffer_size"`      // buffer size for maps
	ChanBufferSize int             `json:"chan_buffer_size"` // buffer size for channels
	MultiVersion   bool            `json:"multiversion"`     // create multi-version database
	Timeout        int             `json:"timeout"`
	ByzNo          int             `json:"byzNo"`
	BSize          int             `json:"bsize"`
	Fixed          bool            `json:"fixed"`
	Benchmark      Bconfig         `json:"benchmark"` // benchmark configuration
	Delta          int             `json:"delta"`     // timeout, seconds
	Pprof          bool            `json:"pprof"`
	MaxRound       int             `json:"maxRound"`
	Strategy       string          `json:"strategy"`
	PayloadSize    int             `json:"payload_size"`
	Master         identity.NodeID `json:"master"`
	Delay          int             `json:"delay"` // transmission delay in ms
	DErr           int             `json:"derr"`  // the err taken into delays
	MemSize        int             `json:"memsize"`
	Slow           int             `json:"slow"`
	Crash          int             `json:"crash"`
	// contains filtered or unexported fields
}

Config contains every system configuration

var Configuration Config

Config is global configuration singleton generated by init() func below

func GetConfig

func GetConfig() Config

GetConfig returns paxi package configuration

func MakeDefaultConfig

func MakeDefaultConfig() Config

MakeDefaultConfig returns Config object with few default values only used by init() and master

func (Config) GetHashScheme

func (c Config) GetHashScheme() string

GetHash returns the hashing scheme of the configuration

func (Config) GetSignatureScheme

func (c Config) GetSignatureScheme() string

func (Config) IDs

func (c Config) IDs() []identity.NodeID

IDs returns all node ids

func (Config) IsByzantine

func (c Config) IsByzantine(id identity.NodeID) bool

func (*Config) Load

func (c *Config) Load()

Load loads configuration from Configuration file in JSON format

func (Config) N

func (c Config) N() int

N returns total number of nodes

func (Config) Save

func (c Config) Save() error

Save saves configuration to file in JSON format

func (Config) String

func (c Config) String() string

String is implemented to print the Configuration

Jump to

Keyboard shortcuts

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