Documentation ¶
Index ¶
- Constants
- func MessageTypeString(m Message) string
- type Accept
- type AcceptReply
- type Ballot
- func (b *Ballot) Clone() *Ballot
- func (b *Ballot) Compare(other *Ballot) int
- func (b *Ballot) FromUint64(num uint64)
- func (b *Ballot) GetEpoch() uint32
- func (b *Ballot) GetNumber() uint64
- func (b *Ballot) GetReplicaId() uint8
- func (b *Ballot) IncNumClone() *Ballot
- func (b *Ballot) IncNumber()
- func (b *Ballot) IsInitialBallot() bool
- func (b *Ballot) SetNumber(number uint64)
- func (b *Ballot) SetReplicaId(rId uint8)
- func (b *Ballot) String() string
- func (b *Ballot) ToUint64() uint64
- type Command
- type Commands
- type Commit
- type Dependencies
- type Message
- type PreAccept
- type PreAcceptOk
- type PreAcceptReply
- type Prepare
- type PrepareReply
- type Propose
- type Timeout
Constants ¶
View Source
const ( ProposeMsg uint8 = iota + 1 PreAcceptMsg PreAcceptOkMsg PreAcceptReplyMsg AcceptMsg AcceptReplyMsg CommitMsg PrepareMsg PrepareReplyMsg TimeoutMsg )
Variables ¶
This section is empty.
Functions ¶
func MessageTypeString ¶
Types ¶
type Accept ¶
type AcceptReply ¶
func (*AcceptReply) Content ¶
func (a *AcceptReply) Content() interface{}
func (*AcceptReply) Instance ¶
func (p *AcceptReply) Instance() uint64
func (*AcceptReply) Replica ¶
func (p *AcceptReply) Replica() uint8
func (*AcceptReply) Sender ¶
func (a *AcceptReply) Sender() uint8
func (*AcceptReply) String ¶
func (p *AcceptReply) String() string
func (*AcceptReply) Type ¶
func (a *AcceptReply) Type() uint8
type Ballot ¶
func (*Ballot) FromUint64 ¶
func (*Ballot) GetReplicaId ¶
func (*Ballot) IncNumClone ¶
func (*Ballot) IsInitialBallot ¶
func (*Ballot) SetReplicaId ¶
type Commit ¶
type Commit struct { ReplicaId uint8 InstanceId uint64 Cmds Commands Deps Dependencies From uint8 }
type Dependencies ¶
type Dependencies []uint64
func (Dependencies) Clone ¶
func (d Dependencies) Clone() Dependencies
func (Dependencies) SameAs ¶
func (d Dependencies) SameAs(other Dependencies) bool
func (Dependencies) Union ¶
func (d Dependencies) Union(other Dependencies) bool
union unions the deps into the receiver return true if deps are changed
type PreAccept ¶
type PreAcceptOk ¶
we don't need ReplicaId in PreAcceptOk, because only the leader will receive this message.
func (*PreAcceptOk) Content ¶
func (p *PreAcceptOk) Content() interface{}
func (*PreAcceptOk) Instance ¶
func (p *PreAcceptOk) Instance() uint64
func (*PreAcceptOk) Replica ¶
func (p *PreAcceptOk) Replica() uint8
func (*PreAcceptOk) String ¶
func (p *PreAcceptOk) String() string
func (*PreAcceptOk) Type ¶
func (p *PreAcceptOk) Type() uint8
type PreAcceptReply ¶
type PreAcceptReply struct { ReplicaId uint8 InstanceId uint64 Deps Dependencies Ballot *Ballot From uint8 }
func (*PreAcceptReply) Content ¶
func (p *PreAcceptReply) Content() interface{}
func (*PreAcceptReply) Instance ¶
func (p *PreAcceptReply) Instance() uint64
func (*PreAcceptReply) Replica ¶
func (p *PreAcceptReply) Replica() uint8
func (*PreAcceptReply) String ¶
func (p *PreAcceptReply) String() string
func (*PreAcceptReply) Type ¶
func (p *PreAcceptReply) Type() uint8
type PrepareReply ¶
type PrepareReply struct { ReplicaId uint8 InstanceId uint64 Status uint8 Cmds Commands Deps Dependencies Ballot *Ballot // These two are used for identical non orignal leader pre-accept reply OriginalBallot *Ballot IsFromLeader bool From uint8 }
func (*PrepareReply) Content ¶
func (p *PrepareReply) Content() interface{}
func (*PrepareReply) Instance ¶
func (p *PrepareReply) Instance() uint64
func (*PrepareReply) Replica ¶
func (p *PrepareReply) Replica() uint8
func (*PrepareReply) Sender ¶
func (p *PrepareReply) Sender() uint8
func (*PrepareReply) String ¶
func (p *PrepareReply) String() string
func (*PrepareReply) Type ¶
func (p *PrepareReply) Type() uint8
type Propose ¶
Click to show internal directories.
Click to hide internal directories.