curp

package
v0.0.0-...-3e9ff4f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NORMAL = iota
	RECOVERING
)

status

View Source
const (
	START = iota
	ACCEPT
	COMMIT
)

phase

View Source
const (
	HISTORY_SIZE = 10010001
	TRUE         = uint8(1)
	FALSE        = uint8(0)
	ORDERED      = uint8(2)
)

Variables

View Source
var MaxDescRoutines = 100

Functions

This section is empty.

Types

type Batcher

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

func NewBatcher

func NewBatcher(r *Replica, size int) *Batcher

func (*Batcher) SendAccept

func (b *Batcher) SendAccept(a *MAccept)

func (*Batcher) SendAcceptAck

func (b *Batcher) SendAcceptAck(a *MAcceptAck)

type Client

type Client struct {
	*client.BufferClient

	N int

	Q replica.ThreeQuarters
	M replica.Majority
	// contains filtered or unexported fields
}

func NewClient

func NewClient(b *client.BufferClient, repNum, reqNum, pclients int) *Client

pclients - Number of clients already running on other machines This is needed to generate a new key for each new request

type CommandId

type CommandId struct {
	ClientId int32
	SeqNum   int32
}

func (*CommandId) BinarySize

func (t *CommandId) BinarySize() (nbytes int, sizeKnown bool)

func (*CommandId) Marshal

func (t *CommandId) Marshal(wire io.Writer)

func (CommandId) String

func (cmdId CommandId) String() string

func (*CommandId) Unmarshal

func (t *CommandId) Unmarshal(wire io.Reader) error

type CommandIdCache

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

func NewCommandIdCache

func NewCommandIdCache() *CommandIdCache

func (*CommandIdCache) Get

func (p *CommandIdCache) Get() *CommandId

func (*CommandIdCache) Put

func (p *CommandIdCache) Put(t *CommandId)

type CommunicationSupply

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

type MAAcks

type MAAcks struct {
	Acks    []MAcceptAck
	Accepts []MAccept
}

func (*MAAcks) BinarySize

func (t *MAAcks) BinarySize() (nbytes int, sizeKnown bool)

func (*MAAcks) Marshal

func (t *MAAcks) Marshal(wire io.Writer)

func (*MAAcks) New

func (m *MAAcks) New() fastrpc.Serializable

func (*MAAcks) Unmarshal

func (t *MAAcks) Unmarshal(rr io.Reader) error

type MAAcksCache

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

func NewMAAcksCache

func NewMAAcksCache() *MAAcksCache

func (*MAAcksCache) Get

func (p *MAAcksCache) Get() *MAAcks

func (*MAAcksCache) Put

func (p *MAAcksCache) Put(t *MAAcks)

type MAccept

type MAccept struct {
	Replica int32
	Ballot  int32
	Cmd     state.Command
	CmdId   CommandId
	CmdSlot int
}

func (*MAccept) BinarySize

func (t *MAccept) BinarySize() (nbytes int, sizeKnown bool)

func (*MAccept) Marshal

func (t *MAccept) Marshal(wire io.Writer)

func (*MAccept) New

func (m *MAccept) New() fastrpc.Serializable

func (*MAccept) Unmarshal

func (t *MAccept) Unmarshal(wire io.Reader) error

type MAcceptAck

type MAcceptAck struct {
	Replica int32
	Ballot  int32
	CmdSlot int
}

func (*MAcceptAck) BinarySize

func (t *MAcceptAck) BinarySize() (nbytes int, sizeKnown bool)

func (*MAcceptAck) Marshal

func (t *MAcceptAck) Marshal(wire io.Writer)

func (*MAcceptAck) New

func (m *MAcceptAck) New() fastrpc.Serializable

func (*MAcceptAck) Unmarshal

func (t *MAcceptAck) Unmarshal(wire io.Reader) error

type MAcceptAckCache

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

func NewMAcceptAckCache

func NewMAcceptAckCache() *MAcceptAckCache

func (*MAcceptAckCache) Get

func (p *MAcceptAckCache) Get() *MAcceptAck

func (*MAcceptAckCache) Put

func (p *MAcceptAckCache) Put(t *MAcceptAck)

type MAcceptCache

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

func NewMAcceptCache

func NewMAcceptCache() *MAcceptCache

func (*MAcceptCache) Get

func (p *MAcceptCache) Get() *MAccept

func (*MAcceptCache) Put

func (p *MAcceptCache) Put(t *MAccept)

type MCommit

type MCommit struct {
	Replica int32
	Ballot  int32
	CmdSlot int
}

func (*MCommit) BinarySize

func (t *MCommit) BinarySize() (nbytes int, sizeKnown bool)

func (*MCommit) Marshal

func (t *MCommit) Marshal(wire io.Writer)

func (*MCommit) New

func (m *MCommit) New() fastrpc.Serializable

func (*MCommit) Unmarshal

func (t *MCommit) Unmarshal(wire io.Reader) error

type MCommitCache

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

func NewMCommitCache

func NewMCommitCache() *MCommitCache

func (*MCommitCache) Get

func (p *MCommitCache) Get() *MCommit

func (*MCommitCache) Put

func (p *MCommitCache) Put(t *MCommit)

type MRecordAck

type MRecordAck struct {
	Replica int32
	Ballot  int32
	CmdId   CommandId
	Ok      uint8
}

func (*MRecordAck) BinarySize

func (t *MRecordAck) BinarySize() (nbytes int, sizeKnown bool)

func (*MRecordAck) Marshal

func (t *MRecordAck) Marshal(wire io.Writer)

func (*MRecordAck) New

func (m *MRecordAck) New() fastrpc.Serializable

func (*MRecordAck) Unmarshal

func (t *MRecordAck) Unmarshal(wire io.Reader) error

type MRecordAckCache

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

func NewMRecordAckCache

func NewMRecordAckCache() *MRecordAckCache

func (*MRecordAckCache) Get

func (p *MRecordAckCache) Get() *MRecordAck

func (*MRecordAckCache) Put

func (p *MRecordAckCache) Put(t *MRecordAck)

type MReply

type MReply struct {
	Replica int32
	Ballot  int32
	CmdId   CommandId
	Rep     []byte
	Ok      uint8
}

func (*MReply) BinarySize

func (t *MReply) BinarySize() (nbytes int, sizeKnown bool)

func (*MReply) Marshal

func (t *MReply) Marshal(wire io.Writer)

func (*MReply) New

func (m *MReply) New() fastrpc.Serializable

func (*MReply) Unmarshal

func (t *MReply) Unmarshal(rr io.Reader) error

type MReplyCache

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

func NewMReplyCache

func NewMReplyCache() *MReplyCache

func (*MReplyCache) Get

func (p *MReplyCache) Get() *MReply

func (*MReplyCache) Put

func (p *MReplyCache) Put(t *MReply)

type MSync

type MSync struct {
	CmdId CommandId
}

func (*MSync) BinarySize

func (t *MSync) BinarySize() (nbytes int, sizeKnown bool)

func (*MSync) Marshal

func (t *MSync) Marshal(wire io.Writer)

func (*MSync) New

func (m *MSync) New() fastrpc.Serializable

func (*MSync) Unmarshal

func (t *MSync) Unmarshal(wire io.Reader) error

type MSyncCache

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

func NewMSyncCache

func NewMSyncCache() *MSyncCache

func (*MSyncCache) Get

func (p *MSyncCache) Get() *MSync

func (*MSyncCache) Put

func (p *MSyncCache) Put(t *MSync)

type MSyncReply

type MSyncReply struct {
	Replica int32
	Ballot  int32
	CmdId   CommandId
	Rep     []byte
}

func (*MSyncReply) BinarySize

func (t *MSyncReply) BinarySize() (nbytes int, sizeKnown bool)

func (*MSyncReply) Marshal

func (t *MSyncReply) Marshal(wire io.Writer)

func (*MSyncReply) New

func (m *MSyncReply) New() fastrpc.Serializable

func (*MSyncReply) Unmarshal

func (t *MSyncReply) Unmarshal(rr io.Reader) error

type MSyncReplyCache

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

func NewMSyncReplyCache

func NewMSyncReplyCache() *MSyncReplyCache

func (*MSyncReplyCache) Get

func (p *MSyncReplyCache) Get() *MSyncReply

func (*MSyncReplyCache) Put

func (p *MSyncReplyCache) Put(t *MSyncReply)

type Replica

type Replica struct {
	*replica.Replica

	Q replica.Majority
	// contains filtered or unexported fields
}

func New

func New(alias string, rid int, addrs []string, exec bool, pl, f int,
	opt bool, conf *config.Config, logger *dlog.Logger) *Replica

func (*Replica) IfPreviousAreReady

func (r *Replica) IfPreviousAreReady(desc *commandDesc, f func())

type Timer

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

func NewTimer

func NewTimer() *Timer

func (*Timer) Reset

func (t *Timer) Reset(wait time.Duration)

func (*Timer) Start

func (t *Timer) Start(wait time.Duration)

func (*Timer) Stop

func (t *Timer) Stop()

Jump to

Keyboard shortcuts

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