Documentation ¶
Index ¶
- Constants
- type Beacon
- type LatencyOracle
- type Propose
- type RPCPair
- type Replica
- func (r *Replica) BeTheLeader(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
- func (r *Replica) CalculateAlive()
- func (r *Replica) ClientFlushFBuffer(cli int32)
- func (r *Replica) ConnectToPeers()
- func (r *Replica) ConnectToPeersNoListeners()
- func (r *Replica) CopyEWMA() []float64
- func (r *Replica) Crash()
- func (r *Replica) FastQuorumSize() int
- func (r *Replica) FromCandidatesSelectBestLatency(candidates [][]int32) []int32
- func (r *Replica) FromCandidatesSelectRandom(candidates [][]int32) []int32
- func (r *Replica) GetAlive() []bool
- func (r *Replica) GetAliveRandomPeerOrder() []int32
- func (r *Replica) GetLatency(rId int32) time.Duration
- func (r *Replica) GetPeerLatencies() []time.Duration
- func (r *Replica) GetPeerOrderLatency() []int32
- func (r *Replica) GetRandomPeerOrder() []int32
- func (r *Replica) PeerFlushBuffer(to int32)
- func (r *Replica) Ping(args *genericsmrproto.PingArgs, reply *genericsmrproto.PingReply) error
- func (r *Replica) RandomisePeerOrder()
- func (r *Replica) ReadQuorumSize() int
- func (r *Replica) RegisterRPC(msgObj fastrpc.Serializable, notify chan fastrpc.Serializable) uint8
- func (r *Replica) ReplyBeacon(beacon *Beacon)
- func (r *Replica) ReplyProposeTS(reply *genericsmrproto.ProposeReplyTS, w *bufio.Writer, lock *sync.Mutex)
- func (r *Replica) SendBeacon(peerId int32)
- func (r *Replica) SendMsg(peerId int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) SendMsgNoFlush(peerId int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) SendMsgNoFlushUNSAFE(peerId int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) SendMsgUNSAFE(peerId int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) SendToGroup(group []int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) SlowQuorumSize() int
- func (r *Replica) WaitForClientConnections()
- func (r *Replica) WriteQuorumSize() int
Constants ¶
View Source
const CHAN_BUFFER_SIZE = 200000
View Source
const FALSE = uint8(0)
View Source
const TRUE = uint8(1)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LatencyOracle ¶
type RPCPair ¶
type RPCPair struct { Obj fastrpc.Serializable Chan chan fastrpc.Serializable }
type Replica ¶
type Replica struct { N int // total number of replicas Id int32 // the ID of the current replica PeerAddrList []string // array with the IP:port address of every replica Peers []net.Conn // cache of connections to all other replicas PeerReaders []*bufio.Reader PeerWriters []*bufio.Writer Alive []bool // connection status Listener net.Listener Clients []net.Conn ClientsReaders []*bufio.Reader ClientsWriters []*bufio.Writer State *state.State ProposeChan chan *Propose // channel for client proposals BeaconChan chan *Beacon // channel for beacons from peer replicas Shutdown bool Thrifty bool // send only as many messages as strictly required? Exec bool // execute commands? LRead bool // execute local reads? Dreply bool // reply to client after command has been executed? Beacon bool // send beacons to detect how fast are the other replicas? F int Durable bool // log to a stable store? StableStorage *os.File // file support for the persistent log PreferredPeerOrder []int32 // replicas in the preferred order of communication Ewma []float64 ReplicasLatenciesOrders []int32 Mutex sync.Mutex Stats *genericsmrproto.Stats // contains filtered or unexported fields }
func NewReplica ¶
func (*Replica) BeTheLeader ¶
func (r *Replica) BeTheLeader(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
func (*Replica) CalculateAlive ¶
func (r *Replica) CalculateAlive()
func (*Replica) ClientFlushFBuffer ¶
func (*Replica) ConnectToPeers ¶
func (r *Replica) ConnectToPeers()
func (*Replica) ConnectToPeersNoListeners ¶
func (r *Replica) ConnectToPeersNoListeners()
func (*Replica) FromCandidatesSelectBestLatency ¶
func (*Replica) FromCandidatesSelectRandom ¶
func (*Replica) GetAliveRandomPeerOrder ¶
func (*Replica) GetPeerLatencies ¶
func (*Replica) GetPeerOrderLatency ¶
returns all alive acceptors ordered by latency (including self)
func (*Replica) GetRandomPeerOrder ¶
returns all alive acceptors ordered by random (including self)
func (*Replica) PeerFlushBuffer ¶
func (*Replica) Ping ¶
func (r *Replica) Ping(args *genericsmrproto.PingArgs, reply *genericsmrproto.PingReply) error
func (*Replica) RandomisePeerOrder ¶
func (r *Replica) RandomisePeerOrder()
func (*Replica) ReadQuorumSize ¶
func (*Replica) RegisterRPC ¶
func (r *Replica) RegisterRPC(msgObj fastrpc.Serializable, notify chan fastrpc.Serializable) uint8
func (*Replica) ReplyBeacon ¶
func (*Replica) ReplyProposeTS ¶
func (r *Replica) ReplyProposeTS(reply *genericsmrproto.ProposeReplyTS, w *bufio.Writer, lock *sync.Mutex)
func (*Replica) SendBeacon ¶
func (*Replica) SendMsg ¶
func (r *Replica) SendMsg(peerId int32, code uint8, msg fastrpc.Serializable)
func (*Replica) SendMsgNoFlush ¶
func (r *Replica) SendMsgNoFlush(peerId int32, code uint8, msg fastrpc.Serializable)
func (*Replica) SendMsgNoFlushUNSAFE ¶
func (r *Replica) SendMsgNoFlushUNSAFE(peerId int32, code uint8, msg fastrpc.Serializable)
func (*Replica) SendMsgUNSAFE ¶
func (r *Replica) SendMsgUNSAFE(peerId int32, code uint8, msg fastrpc.Serializable)
func (*Replica) SendToGroup ¶
func (r *Replica) SendToGroup(group []int32, code uint8, msg fastrpc.Serializable)
func (*Replica) SlowQuorumSize ¶
func (*Replica) WaitForClientConnections ¶
func (r *Replica) WaitForClientConnections()
Client connections dispatcher
Click to show internal directories.
Click to hide internal directories.