acceptor

package
v0.0.0-...-daaf58e Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptorRole

type AcceptorRole struct {
	// contains filtered or unexported fields
}

* Acceptor Role

func Construct

func Construct(roleId uint64, log *replicatedlog.Log) *AcceptorRole

Constructor for AcceptorRole

func (*AcceptorRole) Accept

func (this *AcceptorRole) Accept(proposal *ProposalReq, reply *ProposalResp) error

func (*AcceptorRole) Prepare

func (this *AcceptorRole) Prepare(req *PrepareReq, reply *PrepareResp) error

func (*AcceptorRole) Success

func (this *AcceptorRole) Success(info *SuccessNotify, reply *int) error

type PrepareReq

type PrepareReq struct {
	ProposalId proposal.Id
	Index      int
}

Request sent out by proposer during prepare phase

type PrepareResp

type PrepareResp struct {
	PromiseAccepted    bool
	AcceptedProposalId proposal.Id
	AcceptedValue      string
	NoMoreAccepted     bool
	RoleId             uint64
}

Response sent by acceptors during prepare phase

type ProposalReq

type ProposalReq struct {
	ProposalId         proposal.Id
	Index              int
	Value              string
	FirstUnchosenIndex int
}

Request sent out by proposer during proposal phase

type ProposalResp

type ProposalResp struct {
	AcceptedId         proposal.Id
	RoleId             uint64
	FirstUnchosenIndex int
}

Response sent by acceptors during proposal phase

type SuccessNotify

type SuccessNotify struct {
	Index int
	Value string
}

Jump to

Keyboard shortcuts

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