replicatedlog

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

func ConstructLog

func ConstructLog(roleId uint64, disk *recovery.Manager) (*Log, error)

Creates a new replicated log instance, using data from cold storage files

func (*Log) GetEntryAt

func (this *Log) GetEntryAt(index int) LogEntry

Returns details of the log entry at the specified index

func (*Log) GetFirstUnchosenIndex

func (this *Log) GetFirstUnchosenIndex() int

Returns the index of the first entry in the log for which no value has been chosen

func (*Log) GetMinProposalId

func (this *Log) GetMinProposalId() proposal.Id

Returns the minimum proposal for this log; all lesser proposals should be rejected

func (*Log) MarkAsChosen

func (this *Log) MarkAsChosen(proposalId proposal.Id, upto int)

Marks all log entries with the given proposalId as chosen, up to the given index

func (*Log) NoMoreAcceptedPast

func (this *Log) NoMoreAcceptedPast(index int) bool

Certifies that no proposals have been accepted past the specified index

func (*Log) SetEntryAt

func (this *Log) SetEntryAt(index int, value string, proposalId proposal.Id)

Sets the value of the log entry at the specified index

func (*Log) UpdateMinProposalId

func (this *Log) UpdateMinProposalId(proposalId proposal.Id) proposal.Id

Updates minProposalId to the greater of itself and the provided proposalId

type LogEntry

type LogEntry struct {
	Index              int
	Value              string
	AcceptedProposalId proposal.Id
}

Jump to

Keyboard shortcuts

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