Documentation ¶
Index ¶
- Constants
- Variables
- func IsNilDepOfCmdId(cmdId CommandId, dep Dep) bool
- func NewReplyChan(r *Replica) *replyChan
- func SHashesEq(hs1 []SHash, hs2 []SHash) bool
- type Ack
- type AckCache
- type Batcher
- type BatcherOp
- type Client
- type CommandId
- type CommandIdCache
- type CommunicationSupply
- type DelayEntry
- type DelayLog
- type Dep
- type HashLog
- type HashNode
- type MAccept
- type MAcceptCache
- type MAcks
- type MAcksCache
- type MCollect
- type MCollectCache
- type MFastAck
- type MFastAckCache
- type MFastAckClient
- type MFastAckClientCache
- type MLightSlowAck
- type MLightSlowAckCache
- type MLightSync
- type MLightSyncCache
- type MNewLeader
- type MNewLeaderAck
- type MNewLeaderAckCache
- type MNewLeaderAckN
- type MNewLeaderAckNCache
- type MNewLeaderCache
- type MOptAcks
- type MOptAcksCache
- type MPing
- type MPingCache
- type MPingRep
- type MPingRepCache
- type MReply
- type MReplyCache
- type MShareState
- type MShareStateCache
- type MSlowAck
- type MSlowAckCache
- type MSync
- type Replica
- type SDep
- type SDepCache
- type SHash
- type SHashCache
- type SwapValue
- type UpdateEntry
Constants ¶
View Source
const ( NORMAL = iota RECOVERING )
status
View Source
const ( START = iota PRE_ACCEPT ACCEPT COMMIT )
phase
View Source
const ( BAD_CONT = 3 THRESHOLD = time.Duration(210 * time.Millisecond) PING_DELAY = time.Duration(10 * time.Millisecond) )
View Source
const HISTORY_SIZE = 10010001
Variables ¶
View Source
var MaxDescRoutines = 100
Functions ¶
func IsNilDepOfCmdId ¶
func NewReplyChan ¶
func NewReplyChan(r *Replica) *replyChan
Types ¶
type Ack ¶
func (*Ack) BinarySize ¶
type AckCache ¶
type AckCache struct {
// contains filtered or unexported fields
}
func NewAckCache ¶
func NewAckCache() *AckCache
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
func NewBatcher ¶
func NewBatcher(r *Replica, size int, freeFastAck func(*MFastAck), freeSlowAck func(*MLightSlowAck)) *Batcher
func (*Batcher) SendFastAck ¶
func (*Batcher) SendFastAckClient ¶
func (*Batcher) SendLightSlowAck ¶
func (b *Batcher) SendLightSlowAck(s *MLightSlowAck)
func (*Batcher) SendLightSlowAckClient ¶
func (b *Batcher) SendLightSlowAckClient(s *MLightSlowAck, cid int32)
type Client ¶
type CommandId ¶
func (*CommandId) BinarySize ¶
type CommandIdCache ¶
type CommandIdCache struct {
// contains filtered or unexported fields
}
func NewCommandIdCache ¶
func NewCommandIdCache() *CommandIdCache
func (*CommandIdCache) Get ¶
func (p *CommandIdCache) Get() *CommandId
func (*CommandIdCache) Put ¶
func (p *CommandIdCache) Put(t *CommandId)
type CommunicationSupply ¶
type CommunicationSupply struct {
// contains filtered or unexported fields
}
type DelayEntry ¶
type DelayEntry struct {
// contains filtered or unexported fields
}
type DelayLog ¶
type DelayLog struct {
// contains filtered or unexported fields
}
func NewDelayLog ¶
type HashLog ¶
type HashLog struct {
// contains filtered or unexported fields
}
func NewHashLog ¶
func NewHashLog() *HashLog
type MAccept ¶
func (*MAccept) BinarySize ¶
func (*MAccept) New ¶
func (m *MAccept) New() fastrpc.Serializable
type MAcceptCache ¶
type MAcceptCache struct {
// contains filtered or unexported fields
}
func NewMAcceptCache ¶
func NewMAcceptCache() *MAcceptCache
func (*MAcceptCache) Get ¶
func (p *MAcceptCache) Get() *MAccept
func (*MAcceptCache) Put ¶
func (p *MAcceptCache) Put(t *MAccept)
type MAcks ¶
type MAcks struct { FastAcks []MFastAck LightSlowAcks []MLightSlowAck }
func (*MAcks) BinarySize ¶
func (*MAcks) New ¶
func (m *MAcks) New() fastrpc.Serializable
type MAcksCache ¶
type MAcksCache struct {
// contains filtered or unexported fields
}
func NewMAcksCache ¶
func NewMAcksCache() *MAcksCache
func (*MAcksCache) Get ¶
func (p *MAcksCache) Get() *MAcks
func (*MAcksCache) Put ¶
func (p *MAcksCache) Put(t *MAcks)
type MCollect ¶
func (*MCollect) BinarySize ¶
func (*MCollect) New ¶
func (m *MCollect) New() fastrpc.Serializable
type MCollectCache ¶
type MCollectCache struct {
// contains filtered or unexported fields
}
func NewMCollectCache ¶
func NewMCollectCache() *MCollectCache
func (*MCollectCache) Get ¶
func (p *MCollectCache) Get() *MCollect
func (*MCollectCache) Put ¶
func (p *MCollectCache) Put(t *MCollect)
type MFastAck ¶
type MFastAck struct { Replica int32 Ballot int32 CmdId CommandId Dep []CommandId Checksum []SHash Seqnum int }
func (*MFastAck) BinarySize ¶
func (*MFastAck) New ¶
func (m *MFastAck) New() fastrpc.Serializable
type MFastAckCache ¶
type MFastAckCache struct {
// contains filtered or unexported fields
}
func NewMFastAckCache ¶
func NewMFastAckCache() *MFastAckCache
func (*MFastAckCache) Get ¶
func (p *MFastAckCache) Get() *MFastAck
func (*MFastAckCache) Put ¶
func (p *MFastAckCache) Put(t *MFastAck)
type MFastAckClient ¶
func (*MFastAckClient) BinarySize ¶
func (t *MFastAckClient) BinarySize() (nbytes int, sizeKnown bool)
func (*MFastAckClient) Marshal ¶
func (t *MFastAckClient) Marshal(wire io.Writer)
func (*MFastAckClient) New ¶
func (m *MFastAckClient) New() fastrpc.Serializable
type MFastAckClientCache ¶
type MFastAckClientCache struct {
// contains filtered or unexported fields
}
func NewMFastAckClientCache ¶
func NewMFastAckClientCache() *MFastAckClientCache
func (*MFastAckClientCache) Get ¶
func (p *MFastAckClientCache) Get() *MFastAckClient
func (*MFastAckClientCache) Put ¶
func (p *MFastAckClientCache) Put(t *MFastAckClient)
type MLightSlowAck ¶
func (*MLightSlowAck) BinarySize ¶
func (t *MLightSlowAck) BinarySize() (nbytes int, sizeKnown bool)
func (*MLightSlowAck) Marshal ¶
func (t *MLightSlowAck) Marshal(wire io.Writer)
func (*MLightSlowAck) New ¶
func (m *MLightSlowAck) New() fastrpc.Serializable
type MLightSlowAckCache ¶
type MLightSlowAckCache struct {
// contains filtered or unexported fields
}
func NewMLightSlowAckCache ¶
func NewMLightSlowAckCache() *MLightSlowAckCache
func (*MLightSlowAckCache) Get ¶
func (p *MLightSlowAckCache) Get() *MLightSlowAck
func (*MLightSlowAckCache) Put ¶
func (p *MLightSlowAckCache) Put(t *MLightSlowAck)
type MLightSync ¶
func (*MLightSync) BinarySize ¶
func (t *MLightSync) BinarySize() (nbytes int, sizeKnown bool)
func (*MLightSync) Marshal ¶
func (t *MLightSync) Marshal(wire io.Writer)
func (*MLightSync) New ¶
func (m *MLightSync) New() fastrpc.Serializable
type MLightSyncCache ¶
type MLightSyncCache struct {
// contains filtered or unexported fields
}
func NewMLightSyncCache ¶
func NewMLightSyncCache() *MLightSyncCache
func (*MLightSyncCache) Get ¶
func (p *MLightSyncCache) Get() *MLightSync
func (*MLightSyncCache) Put ¶
func (p *MLightSyncCache) Put(t *MLightSync)
type MNewLeader ¶
func (*MNewLeader) BinarySize ¶
func (t *MNewLeader) BinarySize() (nbytes int, sizeKnown bool)
func (*MNewLeader) Marshal ¶
func (t *MNewLeader) Marshal(wire io.Writer)
func (*MNewLeader) New ¶
func (m *MNewLeader) New() fastrpc.Serializable
type MNewLeaderAck ¶
func (*MNewLeaderAck) BinarySize ¶
func (t *MNewLeaderAck) BinarySize() (nbytes int, sizeKnown bool)
func (*MNewLeaderAck) Marshal ¶
func (t *MNewLeaderAck) Marshal(wire io.Writer)
func (*MNewLeaderAck) New ¶
func (m *MNewLeaderAck) New() fastrpc.Serializable
type MNewLeaderAckCache ¶
type MNewLeaderAckCache struct {
// contains filtered or unexported fields
}
func NewMNewLeaderAckCache ¶
func NewMNewLeaderAckCache() *MNewLeaderAckCache
func (*MNewLeaderAckCache) Get ¶
func (p *MNewLeaderAckCache) Get() *MNewLeaderAck
func (*MNewLeaderAckCache) Put ¶
func (p *MNewLeaderAckCache) Put(t *MNewLeaderAck)
type MNewLeaderAckN ¶
type MNewLeaderAckN struct { Replica int32 Ballot int32 Cballot int32 CmdIds []CommandId Phases []int Cmds []state.Command Deps []SDep }
func (*MNewLeaderAckN) BinarySize ¶
func (t *MNewLeaderAckN) BinarySize() (nbytes int, sizeKnown bool)
func (*MNewLeaderAckN) Marshal ¶
func (t *MNewLeaderAckN) Marshal(wire io.Writer)
func (*MNewLeaderAckN) New ¶
func (m *MNewLeaderAckN) New() fastrpc.Serializable
type MNewLeaderAckNCache ¶
type MNewLeaderAckNCache struct {
// contains filtered or unexported fields
}
func NewMNewLeaderAckNCache ¶
func NewMNewLeaderAckNCache() *MNewLeaderAckNCache
func (*MNewLeaderAckNCache) Get ¶
func (p *MNewLeaderAckNCache) Get() *MNewLeaderAckN
func (*MNewLeaderAckNCache) Put ¶
func (p *MNewLeaderAckNCache) Put(t *MNewLeaderAckN)
type MNewLeaderCache ¶
type MNewLeaderCache struct {
// contains filtered or unexported fields
}
func NewMNewLeaderCache ¶
func NewMNewLeaderCache() *MNewLeaderCache
func (*MNewLeaderCache) Get ¶
func (p *MNewLeaderCache) Get() *MNewLeader
func (*MNewLeaderCache) Put ¶
func (p *MNewLeaderCache) Put(t *MNewLeader)
type MOptAcks ¶
func (*MOptAcks) BinarySize ¶
func (*MOptAcks) New ¶
func (m *MOptAcks) New() fastrpc.Serializable
type MOptAcksCache ¶
type MOptAcksCache struct {
// contains filtered or unexported fields
}
func NewMOptAcksCache ¶
func NewMOptAcksCache() *MOptAcksCache
func (*MOptAcksCache) Get ¶
func (p *MOptAcksCache) Get() *MOptAcks
func (*MOptAcksCache) Put ¶
func (p *MOptAcksCache) Put(t *MOptAcks)
type MPing ¶
func (*MPing) BinarySize ¶
func (*MPing) New ¶
func (m *MPing) New() fastrpc.Serializable
type MPingCache ¶
type MPingCache struct {
// contains filtered or unexported fields
}
func NewMPingCache ¶
func NewMPingCache() *MPingCache
func (*MPingCache) Get ¶
func (p *MPingCache) Get() *MPing
func (*MPingCache) Put ¶
func (p *MPingCache) Put(t *MPing)
type MPingRep ¶
func (*MPingRep) BinarySize ¶
func (*MPingRep) New ¶
func (m *MPingRep) New() fastrpc.Serializable
type MPingRepCache ¶
type MPingRepCache struct {
// contains filtered or unexported fields
}
func NewMPingRepCache ¶
func NewMPingRepCache() *MPingRepCache
func (*MPingRepCache) Get ¶
func (p *MPingRepCache) Get() *MPingRep
func (*MPingRepCache) Put ¶
func (p *MPingRepCache) Put(t *MPingRep)
type MReply ¶
func (*MReply) BinarySize ¶
func (*MReply) New ¶
func (m *MReply) New() fastrpc.Serializable
type MReplyCache ¶
type MReplyCache struct {
// contains filtered or unexported fields
}
func NewMReplyCache ¶
func NewMReplyCache() *MReplyCache
func (*MReplyCache) Get ¶
func (p *MReplyCache) Get() *MReply
func (*MReplyCache) Put ¶
func (p *MReplyCache) Put(t *MReply)
type MShareState ¶
type MShareState struct {}
func (*MShareState) BinarySize ¶
func (t *MShareState) BinarySize() (nbytes int, sizeKnown bool)
func (*MShareState) Marshal ¶
func (t *MShareState) Marshal(wire io.Writer)
func (*MShareState) New ¶
func (m *MShareState) New() fastrpc.Serializable
type MShareStateCache ¶
type MShareStateCache struct {
// contains filtered or unexported fields
}
func NewMShareStateCache ¶
func NewMShareStateCache() *MShareStateCache
func (*MShareStateCache) Get ¶
func (p *MShareStateCache) Get() *MShareState
func (*MShareStateCache) Put ¶
func (p *MShareStateCache) Put(t *MShareState)
type MSlowAck ¶
type MSlowAck struct { Replica int32 Ballot int32 CmdId CommandId Dep []CommandId Checksum []SHash }
func (*MSlowAck) BinarySize ¶
func (*MSlowAck) New ¶
func (m *MSlowAck) New() fastrpc.Serializable
type MSlowAckCache ¶
type MSlowAckCache struct {
// contains filtered or unexported fields
}
func NewMSlowAckCache ¶
func NewMSlowAckCache() *MSlowAckCache
func (*MSlowAckCache) Get ¶
func (p *MSlowAckCache) Get() *MSlowAck
func (*MSlowAckCache) Put ¶
func (p *MSlowAckCache) Put(t *MSlowAck)
type MSync ¶
type MSync struct { Replica int32 Ballot int32 Phases map[CommandId]int Cmds map[CommandId]state.Command Deps map[CommandId]Dep }
func (*MSync) New ¶
func (m *MSync) New() fastrpc.Serializable
type Replica ¶
type Replica struct { *replica.Replica SQ replica.QuorumI FQ replica.QuorumI // contains filtered or unexported fields }
func (*Replica) BeTheLeader ¶
func (r *Replica) BeTheLeader(_ *defs.BeTheLeaderArgs, reply *defs.BeTheLeaderReply) error
TODO: do something more elegant
type SDepCache ¶
type SDepCache struct {
// contains filtered or unexported fields
}
func NewSDepCache ¶
func NewSDepCache() *SDepCache
type SHashCache ¶
type SHashCache struct {
// contains filtered or unexported fields
}
func NewSHashCache ¶
func NewSHashCache() *SHashCache
func (*SHashCache) Get ¶
func (p *SHashCache) Get() *SHash
func (*SHashCache) Put ¶
func (p *SHashCache) Put(t *SHash)
type UpdateEntry ¶
type UpdateEntry struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.