Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare(bn1 *BallotNumber, bn2 *BallotNumber) int
Compare two Ballot numbers lexicographically The result will be:
0 if bn1 == bn2, -1 if bn1 < bn2, and +1 if bn1 > bn2.
Types ¶
type BallotNumber ¶
type BallotNumber struct { // a monotonically increasing integer Round int // Represents a the leader identifier with this ballot number LeaderID v1.Addr }
A BallotNumber in paxos has the property that it has can lexicographically ordered. s.t they can be totally ordered
func (BallotNumber) String ¶
func (bn BallotNumber) String() string
type BasicCommand ¶
type BasicCommand struct { // Client unique Id ClientID string // Unique command ID CommandID string // Operation associated with this command Op string }
Indicates a unique Command issued by the client to a Replica For a unique <ClientID, CommandID> will always map to a unique Op.
func (BasicCommand) GetClientID ¶
func (b BasicCommand) GetClientID() string
func (BasicCommand) GetCommandID ¶
func (b BasicCommand) GetCommandID() string
func (BasicCommand) GetOp ¶
func (b BasicCommand) GetOp() string
func (BasicCommand) String ¶
func (b BasicCommand) String() string
type PValue ¶
type PValue struct { // Ballot number associated BN BallotNumber // Slot for this PValue Slot Slot // Command for this PValue Command Command }
type ReConfigCommand ¶
type ReConfigCommand struct { BasicCommand // New leader configuration NewLeaders []v1.Addr }
A Reconfiguration Command issued
type Slot ¶
type Slot int
Represents a slot which is assigned to a Command in Paxos
const InitialSlotID Slot = 1
The initial slot ID
type SlotCommandMap ¶
func (SlotCommandMap) Assign ¶
func (s SlotCommandMap) Assign(slot Slot, c Command)
func (SlotCommandMap) Contains ¶
func (s SlotCommandMap) Contains(slot Slot) bool
func (SlotCommandMap) Remove ¶
func (s SlotCommandMap) Remove(slot Slot)
Click to show internal directories.
Click to hide internal directories.