defs

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROPOSE uint8 = iota
	PROPOSE_REPLY
	READ
	READ_REPLY
	PROPOSE_AND_READ
	PROPOSE_AND_READ_REPLY
	GENERIC_SMR_BEACON
	GENERIC_SMR_BEACON_REPLY
	STATS
	RPC_TABLE
)
View Source
const (
	CHAN_BUFFER_SIZE = 2000000
	TRUE             = uint8(1)
	FALSE            = uint8(0)
)
View Source
const (
	LOG_INSERT = iota
	LOG_HANDLE
)

Variables

View Source
var (
	Storage      = ""
	StoreFilname = "stable_store"
)
View Source
var LatencyConf = ""

Functions

func IP

func IP() string

func UpdateBeTheLeaderReply

func UpdateBeTheLeaderReply(btlr *BeTheLeaderReply)

Types

type BeTheLeaderArgs

type BeTheLeaderArgs struct{}

func (*BeTheLeaderArgs) BinarySize

func (t *BeTheLeaderArgs) BinarySize() (nbytes int, sizeKnown bool)

func (*BeTheLeaderArgs) Marshal

func (t *BeTheLeaderArgs) Marshal(wire io.Writer)

func (*BeTheLeaderArgs) Unmarshal

func (t *BeTheLeaderArgs) Unmarshal(wire io.Reader) error

type BeTheLeaderArgsCache

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

func NewBeTheLeaderArgsCache

func NewBeTheLeaderArgsCache() *BeTheLeaderArgsCache

func (*BeTheLeaderArgsCache) Get

func (*BeTheLeaderArgsCache) Put

type BeTheLeaderReply

type BeTheLeaderReply struct {
	Leader     int32
	NextLeader int32
}

func NewBeTheLeaderReply

func NewBeTheLeaderReply() *BeTheLeaderReply

func (*BeTheLeaderReply) BinarySize

func (t *BeTheLeaderReply) BinarySize() (nbytes int, sizeKnown bool)

func (*BeTheLeaderReply) IsDefault

func (r *BeTheLeaderReply) IsDefault() bool

func (*BeTheLeaderReply) Marshal

func (t *BeTheLeaderReply) Marshal(wire io.Writer)

func (*BeTheLeaderReply) Unmarshal

func (t *BeTheLeaderReply) Unmarshal(wire io.Reader) error

type BeTheLeaderReplyCache

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

func NewBeTheLeaderReplyCache

func NewBeTheLeaderReplyCache() *BeTheLeaderReplyCache

func (*BeTheLeaderReplyCache) Get

func (*BeTheLeaderReplyCache) Put

type Beacon

type Beacon struct {
	Timestamp int64
}

func (*Beacon) BinarySize

func (t *Beacon) BinarySize() (nbytes int, sizeKnown bool)

func (*Beacon) Marshal

func (t *Beacon) Marshal(wire io.Writer)

func (*Beacon) Unmarshal

func (t *Beacon) Unmarshal(wire io.Reader) error

type BeaconCache

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

func NewBeaconCache

func NewBeaconCache() *BeaconCache

func (*BeaconCache) Get

func (p *BeaconCache) Get() *Beacon

func (*BeaconCache) Put

func (p *BeaconCache) Put(t *Beacon)

type BeaconReply

type BeaconReply struct {
	Timestamp int64
}

func (*BeaconReply) BinarySize

func (t *BeaconReply) BinarySize() (nbytes int, sizeKnown bool)

func (*BeaconReply) Marshal

func (t *BeaconReply) Marshal(wire io.Writer)

func (*BeaconReply) Unmarshal

func (t *BeaconReply) Unmarshal(wire io.Reader) error

type BeaconReplyCache

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

func NewBeaconReplyCache

func NewBeaconReplyCache() *BeaconReplyCache

func (*BeaconReplyCache) Get

func (p *BeaconReplyCache) Get() *BeaconReply

func (*BeaconReplyCache) Put

func (p *BeaconReplyCache) Put(t *BeaconReply)

type DelayProposeChan

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

func NewDelayProposeChan

func NewDelayProposeChan(d time.Duration, c chan *GPropose) *DelayProposeChan

func (*DelayProposeChan) Write

func (c *DelayProposeChan) Write(p *GPropose)

type GBeacon

type GBeacon struct {
	Rid       int32
	Timestamp int64
}

type GPropose

type GPropose struct {
	*Propose
	Reply *bufio.Writer
	Mutex *sync.Mutex
	Proxy bool
	Addr  string
}

type GetLeaderArgs

type GetLeaderArgs struct{}

type GetLeaderReply

type GetLeaderReply struct {
	LeaderId int
}

type GetReplicaListArgs

type GetReplicaListArgs struct{}

type GetReplicaListReply

type GetReplicaListReply struct {
	ReplicaList []string
	AliveList   []bool
	Ready       bool
}

type LatencyTable

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

func NewLatencyTable

func NewLatencyTable(conf, myAddr string, addrs []string) *LatencyTable

func (*LatencyTable) WaitDuration

func (dt *LatencyTable) WaitDuration(addr string) time.Duration

func (*LatencyTable) WaitDurationID

func (dt *LatencyTable) WaitDurationID(id int) time.Duration

type PingArgs

type PingArgs struct {
	ActAsLeader uint8
}

func (*PingArgs) BinarySize

func (t *PingArgs) BinarySize() (nbytes int, sizeKnown bool)

func (*PingArgs) Marshal

func (t *PingArgs) Marshal(wire io.Writer)

func (*PingArgs) Unmarshal

func (t *PingArgs) Unmarshal(wire io.Reader) error

type PingArgsCache

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

func NewPingArgsCache

func NewPingArgsCache() *PingArgsCache

func (*PingArgsCache) Get

func (p *PingArgsCache) Get() *PingArgs

func (*PingArgsCache) Put

func (p *PingArgsCache) Put(t *PingArgs)

type PingReply

type PingReply struct{}

func (*PingReply) BinarySize

func (t *PingReply) BinarySize() (nbytes int, sizeKnown bool)

func (*PingReply) Marshal

func (t *PingReply) Marshal(wire io.Writer)

func (*PingReply) Unmarshal

func (t *PingReply) Unmarshal(wire io.Reader) error

type PingReplyCache

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

func NewPingReplyCache

func NewPingReplyCache() *PingReplyCache

func (*PingReplyCache) Get

func (p *PingReplyCache) Get() *PingReply

func (*PingReplyCache) Put

func (p *PingReplyCache) Put(t *PingReply)

type Propose

type Propose struct {
	CommandId int32
	ClientId  int32
	Command   state.Command
	Timestamp int64
}

func (*Propose) BinarySize

func (t *Propose) BinarySize() (nbytes int, sizeKnown bool)

func (*Propose) Marshal

func (t *Propose) Marshal(wire io.Writer)

func (*Propose) Unmarshal

func (t *Propose) Unmarshal(wire io.Reader) error

type ProposeAndRead

type ProposeAndRead struct {
	CommandId int32
	Command   state.Command
	Key       state.Key
}

func (*ProposeAndRead) BinarySize

func (t *ProposeAndRead) BinarySize() (nbytes int, sizeKnown bool)

func (*ProposeAndRead) Marshal

func (t *ProposeAndRead) Marshal(wire io.Writer)

func (*ProposeAndRead) Unmarshal

func (t *ProposeAndRead) Unmarshal(wire io.Reader) error

type ProposeAndReadCache

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

func NewProposeAndReadCache

func NewProposeAndReadCache() *ProposeAndReadCache

func (*ProposeAndReadCache) Get

func (*ProposeAndReadCache) Put

type ProposeAndReadReply

type ProposeAndReadReply struct {
	OK        uint8
	CommandId int32
	Value     state.Value
}

func (*ProposeAndReadReply) BinarySize

func (t *ProposeAndReadReply) BinarySize() (nbytes int, sizeKnown bool)

func (*ProposeAndReadReply) Marshal

func (t *ProposeAndReadReply) Marshal(wire io.Writer)

func (*ProposeAndReadReply) Unmarshal

func (t *ProposeAndReadReply) Unmarshal(wire io.Reader) error

type ProposeAndReadReplyCache

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

func NewProposeAndReadReplyCache

func NewProposeAndReadReplyCache() *ProposeAndReadReplyCache

func (*ProposeAndReadReplyCache) Get

func (*ProposeAndReadReplyCache) Put

type ProposeCache

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

func NewProposeCache

func NewProposeCache() *ProposeCache

func (*ProposeCache) Get

func (p *ProposeCache) Get() *Propose

func (*ProposeCache) Put

func (p *ProposeCache) Put(t *Propose)

type ProposeReply

type ProposeReply struct {
	OK        uint8
	CommandId int32
}

func (*ProposeReply) BinarySize

func (t *ProposeReply) BinarySize() (nbytes int, sizeKnown bool)

func (*ProposeReply) Marshal

func (t *ProposeReply) Marshal(wire io.Writer)

func (*ProposeReply) Unmarshal

func (t *ProposeReply) Unmarshal(wire io.Reader) error

type ProposeReplyCache

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

func NewProposeReplyCache

func NewProposeReplyCache() *ProposeReplyCache

func (*ProposeReplyCache) Get

func (p *ProposeReplyCache) Get() *ProposeReply

func (*ProposeReplyCache) Put

func (p *ProposeReplyCache) Put(t *ProposeReply)

type ProposeReplyTS

type ProposeReplyTS struct {
	OK        uint8
	CommandId int32
	Value     state.Value
	Timestamp int64
}

func (*ProposeReplyTS) BinarySize

func (t *ProposeReplyTS) BinarySize() (nbytes int, sizeKnown bool)

func (*ProposeReplyTS) Marshal

func (t *ProposeReplyTS) Marshal(wire io.Writer)

func (*ProposeReplyTS) Unmarshal

func (t *ProposeReplyTS) Unmarshal(wire io.Reader) error

type ProposeReplyTSCache

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

func NewProposeReplyTSCache

func NewProposeReplyTSCache() *ProposeReplyTSCache

func (*ProposeReplyTSCache) Get

func (*ProposeReplyTSCache) Put

type Read

type Read struct {
	CommandId int32
	Key       state.Key
}

func (*Read) BinarySize

func (t *Read) BinarySize() (nbytes int, sizeKnown bool)

func (*Read) Marshal

func (t *Read) Marshal(wire io.Writer)

func (*Read) Unmarshal

func (t *Read) Unmarshal(wire io.Reader) error

type ReadCache

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

func NewReadCache

func NewReadCache() *ReadCache

func (*ReadCache) Get

func (p *ReadCache) Get() *Read

func (*ReadCache) Put

func (p *ReadCache) Put(t *Read)

type ReadReply

type ReadReply struct {
	CommandId int32
	Value     state.Value
}

func (*ReadReply) BinarySize

func (t *ReadReply) BinarySize() (nbytes int, sizeKnown bool)

func (*ReadReply) Marshal

func (t *ReadReply) Marshal(wire io.Writer)

func (*ReadReply) Unmarshal

func (t *ReadReply) Unmarshal(wire io.Reader) error

type ReadReplyCache

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

func NewReadReplyCache

func NewReadReplyCache() *ReadReplyCache

func (*ReadReplyCache) Get

func (p *ReadReplyCache) Get() *ReadReply

func (*ReadReplyCache) Put

func (p *ReadReplyCache) Put(t *ReadReply)

type RegisterArgs

type RegisterArgs struct {
	Addr string
	Port int
}

type RegisterReply

type RegisterReply struct {
	ReplicaId int
	NodeList  []string
	Ready     bool
	IsLeader  bool
}

type Stats

type Stats struct {
	M map[string]int `json:"stats"`
}

Jump to

Keyboard shortcuts

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