hpaxos

package
v0.0.0-...-6823d0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P1a

type P1a struct {
	Ballot paxi.Ballot
	Slot   int
}

P1a prepare message

func (P1a) String

func (m P1a) String() string

type P1b

type P1b struct {
	Ballot  paxi.Ballot
	Slot    int
	ID      paxi.ID // from node id
	Command paxi.Command
}

P1b promise message

func (P1b) String

func (m P1b) String() string

type P2a

type P2a struct {
	Ballot  paxi.Ballot
	Slot    int
	Command paxi.Command
}

P2a accept message

func (P2a) String

func (m P2a) String() string

type P2b

type P2b struct {
	Ballot paxi.Ballot
	ID     paxi.ID // from node id
	Slot   int
}

P2b accepted message

func (P2b) String

func (m P2b) String() string

type P3

type P3 struct {
	Ballot  paxi.Ballot
	Slot    int
	Command paxi.Command
}

P3 commit message

func (P3) String

func (m P3) String() string

type Paxos

type Paxos struct {
	paxi.Node

	Q1              func(*paxi.Quorum) bool
	Q2              func(*paxi.Quorum) bool
	ReplyWhenCommit bool
	// contains filtered or unexported fields
}

Paxos instance

func NewPaxos

func NewPaxos(n paxi.Node, options ...func(*Paxos)) *Paxos

NewPaxos creates new paxos instance

func (*Paxos) HandleP1a

func (p *Paxos) HandleP1a(m P1a)

func (*Paxos) HandleP1b

func (p *Paxos) HandleP1b(m P1b)

func (*Paxos) HandleP2a

func (p *Paxos) HandleP2a(m P2a)

func (*Paxos) HandleP2b

func (p *Paxos) HandleP2b(m P2b)

func (*Paxos) HandleP3

func (p *Paxos) HandleP3(m P3)

func (*Paxos) HandleRequest

func (p *Paxos) HandleRequest(r paxi.Request)

func (*Paxos) IsLeader

func (p *Paxos) IsLeader(slot int) bool

func (*Paxos) Leader

func (p *Paxos) Leader(slot int) paxi.ID

func (*Paxos) P1a

func (p *Paxos) P1a(r paxi.Request)

func (*Paxos) P2a

func (p *Paxos) P2a(s int)

type Replica

type Replica struct {
	paxi.Node
	*Paxos
}

Replica for one Paxos instance

func NewReplica

func NewReplica(id paxi.ID) *Replica

NewReplica generates new Paxos replica

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL