quorumFunTests

package
v0.0.0-...-1532427 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuoSpecQ

func NewQuoSpecQ(rqSize, wqSize int) q.QuorumSpec

NewQuoSpecQ has quorum sizes for read and write quorum function as input. It returns a quorum spec

func NewQuoSpecQError

func NewQuoSpecQError(rqSize, wqSize int) q.QuorumSpec

NewQuoSpecQError has quorum sizes for read and write quorum function as input. It returns a quorum spec

Types

type QuoSpecQ

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

QuoSpecQ is the quorum specification for the Quorum algorithm.

func (QuoSpecQ) ReadQF

func (qq QuoSpecQ) ReadQF(replies []*q.Value) (*q.Value, bool)

Assumed correct ReadQF: Returns nil and false until the supplied replies. The method returns the single highest value and true.

func (QuoSpecQ) WriteQF

func (qq QuoSpecQ) WriteQF(replies []*q.WriteResponse) (*q.WriteResponse, bool)

Assumed correct WriteQF: Returns WRITENACK (false or nil) and false until it is possible to check for a quorum. If enough replies, we return WRITEACK (true or the first reply) and true.

type QuoSpecQError

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

Programming error scenarios for ReadQF and WriteQF Error scenario one: number of replies and quorum size error in WriteQF Error scenario two: the result of the reply with the highest timestamp error in ReadQF QuoSpecQError is the quorum specification for testing QuorumError scenario.

func (QuoSpecQError) ReadQF

func (qq QuoSpecQError) ReadQF(replies []*q.Value) (*q.Value, bool)

Assumed error ReadQF Error scenario for ReadQF: the result of the reply with the highest timestamp error

func (QuoSpecQError) WriteQF

func (qq QuoSpecQError) WriteQF(replies []*q.WriteResponse) (*q.WriteResponse, bool)

Assumed error WriteQF Error scenario for WriteQF: number of replies and quorum size error

Jump to

Keyboard shortcuts

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