config

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

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

Go to latest
Published: Sep 16, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PORT        = 1735
	HTTP_PORT   = 8080
	BUFFER_SIZE = 1024 * 1
	// TODO merge below two value with with config
	CHAN_BUFFER_SIZE = 1024 * 1
)

default values

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs           map[ids.ID]string `json:"address"`      // address for node communication
	HTTPAddrs       map[ids.ID]string `json:"http_address"` // address for bench server communication
	Quorum          string            `json:"quorum"`       // type of the quorums
	F               int               `json:"f"`            // number of failure zones in general grid quorums
	RS              int               `json:"rs"`           // number of failure zones in a replication region
	LevelDBDir      []string          `json:"leveldb"`      // directory for LevelDB instances
	Transport       string            `json:"transport"`    // not used
	Codec           string            `json:"codec"`
	ReplyWhenCommit bool              `json:"reply_when_commit"` // reply to bench when request is committed, instead of executed
	Adaptive        bool              `json:"adaptive"`          // adaptive leader change, if true paxos forward request to current leader
	Interval        int               `json:"interval"`          // interval for leader change, 0 means immediate
	BackOff         int               `json:"backoff"`           // random backoff interval
	Thrifty         bool              `json:"thrifty"`           // only send messages to a quorum
	ChanBufferSize  int               `json:"chan_buffer_size"`
	BufferSize      int               `json:"buffer_size"`
	BalGossipInt    int64             `json:"balance_gossip_interval"` //Interval between balance data gossip messages in ms
	OverldThrshld   float64           `json:"overload_threshold"`      //how many percent over even distribution is considered to be overlaod
	TX_lease        int               `json:"tx_lease_duration"`       //how long is tx lease (in ms) preventing other nodes from stealing
	HandoverN       int               `json:"handoverN"`               //how many request we need before making polite handover decision
	Migration_maj   float64           `json:"migration_majority"`      //http max idle connection per host
	MaxIdleCnx      int               `json:"max_idle_connections"`    //http max idle connection per host
	CoGAlpha        float32           `json:"cog_alpha"`
	CoGMinNumHits   int               `json:"cog_min_number_hits"`
}
var Instance *Config

func ConnectToMaster

func ConnectToMaster(addr string, client bool, id ids.ID) Config

func MakeDefaultConfig

func MakeDefaultConfig() Config

func (*Config) GetZoneIds

func (c *Config) GetZoneIds() []uint8

func (*Config) Save

func (c *Config) Save() error

Save save configurations to file in JSON format

func (*Config) String

func (c *Config) String() string

String is implemented to print the config

type Register

type Register struct {
	Client bool
	ID     ids.ID
	Addr   string
}

Register message type is used to regitster self (node or bench) with master node

Jump to

Keyboard shortcuts

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