Documentation ¶
Index ¶
- Constants
- Variables
- type Beacon
- type Int64Slice
- type Propose
- type RPCPair
- type Replica
- func (r *Replica) BeTheLeader(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
- func (r *Replica) ConnectToPeers()
- func (r *Replica) ConnectToPeersNoListeners()
- func (r *Replica) EstablishQLease(ql *qlease.Lease)
- func (r *Replica) HandleQLeaseGuard(ql *qlease.Lease, g *qleaseproto.Guard)
- func (r *Replica) HandleQLeaseGuardReply(ql *qlease.Lease, gr *qleaseproto.GuardReply, latestAccInst int32)
- func (r *Replica) HandleQLeasePromise(ql *qlease.Lease, p *qleaseproto.Promise) bool
- func (r *Replica) HandleQLeaseReply(ql *qlease.Lease, pr *qleaseproto.PromiseReply)
- func (r *Replica) Ping(args *genericsmrproto.PingArgs, reply *genericsmrproto.PingReply) error
- func (r *Replica) RegisterRPC(msgObj fastrpc.Serializable, notify chan fastrpc.Serializable) uint8
- func (r *Replica) RenewQLease(ql *qlease.Lease, latestAccInst int32)
- func (r *Replica) ReplyBeacon(beacon *Beacon)
- func (r *Replica) ReplyPropose(reply *genericsmrproto.ProposeReply, propose *Propose)
- func (r *Replica) ReplyProposeTS(reply *genericsmrproto.ProposeReplyTS, propose *Propose)
- func (r *Replica) SendBeacon(peerId int32)
- func (r *Replica) SendMsg(peerId int32, code uint8, msg fastrpc.Serializable) (retErr error)
- func (r *Replica) SendMsgNoFlush(peerId int32, code uint8, msg fastrpc.Serializable) (retErr error)
- func (r *Replica) UpdatePreferredPeerOrder(quorum []int32)
- func (r *Replica) WaitForClientConnections()
Constants ¶
View Source
const ( TRUE = uint8(1) FALSE = uint8(0) )
View Source
const CHAN_BUFFER_SIZE = 500000
Variables ¶
View Source
var SendError bool
Functions ¶
This section is empty.
Types ¶
type Int64Slice ¶
type Int64Slice []int64
func (Int64Slice) Len ¶
func (s Int64Slice) Len() int
func (Int64Slice) Less ¶
func (s Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (s Int64Slice) Swap(i, j int)
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 PeerWLocks []*sync.Mutex Alive []bool // connection status Listener net.Listener 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? Dreply bool // reply to client after command has been executed? Beacon bool // send beacons to detect how fast are the other replicas? Durable bool // log to a stable store? StableStore *os.File // file support for the persistent log PreferredPeerOrder []int32 // replicas in the preferred order of communication QLease *qlease.Lease // the latest quorum lease (nil if not initialized) QLPromiseChan chan fastrpc.Serializable // channel for incoming quorum read lease promises QLPromiseReplyChan chan fastrpc.Serializable // channel for incoming quorum read lease promise-replies QLGuardChan chan fastrpc.Serializable QLGuardReplyChan chan fastrpc.Serializable Updating map[state.Key]bool // set of keys being updated (i.e., the current replica has received a Ewma []float64 OnClientConnect chan bool LastReplyReceivedTimestamp []int64 // contains filtered or unexported fields }
func NewReplica ¶
func (*Replica) BeTheLeader ¶
func (r *Replica) BeTheLeader(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
func (*Replica) ConnectToPeers ¶
func (r *Replica) ConnectToPeers()
func (*Replica) ConnectToPeersNoListeners ¶
func (r *Replica) ConnectToPeersNoListeners()
func (*Replica) EstablishQLease ¶
func (*Replica) HandleQLeaseGuard ¶
func (r *Replica) HandleQLeaseGuard(ql *qlease.Lease, g *qleaseproto.Guard)
func (*Replica) HandleQLeaseGuardReply ¶
func (r *Replica) HandleQLeaseGuardReply(ql *qlease.Lease, gr *qleaseproto.GuardReply, latestAccInst int32)
func (*Replica) HandleQLeasePromise ¶
func (*Replica) HandleQLeaseReply ¶
func (r *Replica) HandleQLeaseReply(ql *qlease.Lease, pr *qleaseproto.PromiseReply)
func (*Replica) Ping ¶
func (r *Replica) Ping(args *genericsmrproto.PingArgs, reply *genericsmrproto.PingReply) error
func (*Replica) RegisterRPC ¶
func (r *Replica) RegisterRPC(msgObj fastrpc.Serializable, notify chan fastrpc.Serializable) uint8
func (*Replica) ReplyBeacon ¶
func (*Replica) ReplyPropose ¶
func (r *Replica) ReplyPropose(reply *genericsmrproto.ProposeReply, propose *Propose)
func (*Replica) ReplyProposeTS ¶
func (r *Replica) ReplyProposeTS(reply *genericsmrproto.ProposeReplyTS, propose *Propose)
func (*Replica) SendBeacon ¶
func (*Replica) SendMsgNoFlush ¶
func (*Replica) UpdatePreferredPeerOrder ¶
updates the preferred order in which to communicate with peers according to a preferred quorum
func (*Replica) WaitForClientConnections ¶
func (r *Replica) WaitForClientConnections()
Client connections dispatcher
Click to show internal directories.
Click to hide internal directories.