config

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

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientMachine = iota
	ReplicaMachine
	MasterMachine
)
View Source
const REMOTE = "none"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Protocol string

	Alias       string
	MachineType Machine

	// associates client/replica alias with the address
	ClientAddrs  map[string]string
	ReplicaAddrs map[string]string

	// -- master info --
	MasterAlias string
	MasterPort  int
	MasterAddr  string

	// -- replica info --
	// do not execute client commands
	Noop bool
	// epaxos thrifty mode
	Thrifty bool
	// optimized reads (when available)
	Optread    bool
	Leaderless bool
	// replicas send replies directly to clients
	Fast bool

	// -- client info --
	// number of client requests
	Reqs int
	// duration during which a client run
	RunTime time.Duration
	// ration of writes
	Writes int
	// conflict ratio
	Conflicts int
	// the size of payload
	CommandSize int
	// number of clones of each client
	Clones int
	// wait reply from the closest replica
	WaitClosest bool
	Pipeline    bool
	// when pipelining the frequency of syncs
	Syncs int
	// when pipelining the maximal number of pending commands
	Pendings int
	// Hot key for this set of clients
	Key int

	// quorum config file
	Quorum string

	Proxy *ProxyInfo
}

func Read

func Read(filename, alias string) (*Config, error)

func (*Config) MapClientToIP

func (c *Config) MapClientToIP(client, ip string)

func (*Config) MapReplicaToIP

func (c *Config) MapReplicaToIP(replica, ip string)

type Error

type Error struct {
	// contains filtered or unexported fields
}

func Err

func Err(field, comment string, errs ...error) *Error

func (*Error) Error

func (err *Error) Error() string

type Machine

type Machine int

type ProxyInfo

type ProxyInfo struct {
	// contains filtered or unexported fields
}

func ReadProxyInfo

func ReadProxyInfo(c *Config, s *bufio.Scanner, end string) *ProxyInfo

func (*ProxyInfo) Clients

func (p *ProxyInfo) Clients() []string

func (*ProxyInfo) IsLocal

func (p *ProxyInfo) IsLocal(serverAlias, clientAddr string) bool

func (*ProxyInfo) IsProxy

func (p *ProxyInfo) IsProxy(serverAlias, clientAddr string) bool

func (*ProxyInfo) LocalWith

func (p *ProxyInfo) LocalWith(clientAddr string) string

func (*ProxyInfo) ProxyOf

func (p *ProxyInfo) ProxyOf(clientAddr string) string

func (*ProxyInfo) ServerClients

func (p *ProxyInfo) ServerClients(server string) []string

func (*ProxyInfo) Servers

func (p *ProxyInfo) Servers() []string

Jump to

Keyboard shortcuts

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