epaxospb

package
v0.0.0-...-425bd36 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package epaxospb is a generated protocol buffer package.

It is generated from these files:

epaxos.proto

It has these top-level messages:

Span
Command
InstanceID
InstanceData
PreAccept
PreAcceptOK
PreAcceptReply
Accept
AcceptOK
Commit
Ballot
Message
InstanceState
HardState

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEpaxos = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEpaxos   = fmt.Errorf("proto: integer overflow")
)
View Source
var InstanceState_Status_name = map[int32]string{
	0: "None",
	1: "PreAccepted",
	2: "Accepted",
	3: "Committed",
	4: "Executed",
}
View Source
var InstanceState_Status_value = map[string]int32{
	"None":        0,
	"PreAccepted": 1,
	"Accepted":    2,
	"Committed":   3,
	"Executed":    4,
}

Functions

func IsReply

func IsReply(t isMessage_Type) bool

IsReply returns whether the message type is a reply or not.

func WrapMessageInner

func WrapMessageInner(msg proto.Message) isMessage_Type

WrapMessageInner wraps a union type of Message in a new isMessage_Type.

Types

type Accept

type Accept struct {
	InstanceData `protobuf:"bytes,1,opt,name=data,embedded=data" json:"data"`
}

func (*Accept) Descriptor

func (*Accept) Descriptor() ([]byte, []int)

func (*Accept) Marshal

func (m *Accept) Marshal() (dAtA []byte, err error)

func (*Accept) MarshalTo

func (m *Accept) MarshalTo(dAtA []byte) (int, error)

func (*Accept) ProtoMessage

func (*Accept) ProtoMessage()

func (*Accept) Reset

func (m *Accept) Reset()

func (*Accept) Size

func (m *Accept) Size() (n int)

func (*Accept) String

func (m *Accept) String() string

func (*Accept) Unmarshal

func (m *Accept) Unmarshal(dAtA []byte) error

type AcceptOK

type AcceptOK struct {
}

func (*AcceptOK) Descriptor

func (*AcceptOK) Descriptor() ([]byte, []int)

func (*AcceptOK) Marshal

func (m *AcceptOK) Marshal() (dAtA []byte, err error)

func (*AcceptOK) MarshalTo

func (m *AcceptOK) MarshalTo(dAtA []byte) (int, error)

func (*AcceptOK) ProtoMessage

func (*AcceptOK) ProtoMessage()

func (*AcceptOK) Reset

func (m *AcceptOK) Reset()

func (*AcceptOK) Size

func (m *AcceptOK) Size() (n int)

func (*AcceptOK) String

func (m *AcceptOK) String() string

func (*AcceptOK) Unmarshal

func (m *AcceptOK) Unmarshal(dAtA []byte) error

type Ballot

type Ballot struct {
	Epoch     uint64    `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
	Number    uint64    `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
	ReplicaID ReplicaID `protobuf:"varint,3,opt,name=replica_id,json=replicaId,proto3,casttype=ReplicaID" json:"replica_id,omitempty"`
}

Ballot is a ballot number that ensures message freshness.

func (Ballot) Compare

func (b Ballot) Compare(b2 Ballot) int

Compare compares the two Ballots. The result will be 0 if b == b2, -1 if b < b2, and +1 if b > b2.

func (*Ballot) Descriptor

func (*Ballot) Descriptor() ([]byte, []int)

func (*Ballot) GetEpoch

func (m *Ballot) GetEpoch() uint64

func (*Ballot) GetNumber

func (m *Ballot) GetNumber() uint64

func (*Ballot) GetReplicaID

func (m *Ballot) GetReplicaID() ReplicaID

func (*Ballot) Marshal

func (m *Ballot) Marshal() (dAtA []byte, err error)

func (*Ballot) MarshalTo

func (m *Ballot) MarshalTo(dAtA []byte) (int, error)

func (*Ballot) ProtoMessage

func (*Ballot) ProtoMessage()

func (*Ballot) Reset

func (m *Ballot) Reset()

func (*Ballot) Size

func (m *Ballot) Size() (n int)

func (*Ballot) String

func (m *Ballot) String() string

func (*Ballot) Unmarshal

func (m *Ballot) Unmarshal(dAtA []byte) error

type Command

type Command struct {
	ID      uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Span    Span   `protobuf:"bytes,2,opt,name=span" json:"span"`
	Writing bool   `protobuf:"varint,3,opt,name=writing,proto3" json:"writing,omitempty"`
	Data    []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
}

func (*Command) Descriptor

func (*Command) Descriptor() ([]byte, []int)

func (*Command) GetData

func (m *Command) GetData() []byte

func (*Command) GetID

func (m *Command) GetID() uint64

func (*Command) GetSpan

func (m *Command) GetSpan() Span

func (*Command) GetWriting

func (m *Command) GetWriting() bool

func (Command) Interferes

func (c Command) Interferes(o Command) bool

Interferes returns whether the two Commands interfere.

func (*Command) Marshal

func (m *Command) Marshal() (dAtA []byte, err error)

func (*Command) MarshalTo

func (m *Command) MarshalTo(dAtA []byte) (int, error)

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) Size

func (m *Command) Size() (n int)

func (Command) String

func (c Command) String() string

String returns a string-formatted version of the Command.

func (*Command) Unmarshal

func (m *Command) Unmarshal(dAtA []byte) error

type Commit

type Commit struct {
	InstanceData `protobuf:"bytes,1,opt,name=data,embedded=data" json:"data"`
}

func (*Commit) Descriptor

func (*Commit) Descriptor() ([]byte, []int)

func (*Commit) Marshal

func (m *Commit) Marshal() (dAtA []byte, err error)

func (*Commit) MarshalTo

func (m *Commit) MarshalTo(dAtA []byte) (int, error)

func (*Commit) ProtoMessage

func (*Commit) ProtoMessage()

func (*Commit) Reset

func (m *Commit) Reset()

func (*Commit) Size

func (m *Commit) Size() (n int)

func (*Commit) String

func (m *Commit) String() string

func (*Commit) Unmarshal

func (m *Commit) Unmarshal(dAtA []byte) error

type HardState

type HardState struct {
	// replica_id is the unique identifier for this node.
	ReplicaID ReplicaID `protobuf:"varint,1,opt,name=replica_id,json=replicaId,proto3,casttype=ReplicaID" json:"replica_id,omitempty"`
	// nodes is the set of all nodes in the EPaxos network.
	Nodes []ReplicaID `protobuf:"varint,2,rep,packed,name=nodes,casttype=ReplicaID" json:"nodes,omitempty"`
}

func (*HardState) Descriptor

func (*HardState) Descriptor() ([]byte, []int)

func (*HardState) GetNodes

func (m *HardState) GetNodes() []ReplicaID

func (*HardState) GetReplicaID

func (m *HardState) GetReplicaID() ReplicaID

func (*HardState) Marshal

func (m *HardState) Marshal() (dAtA []byte, err error)

func (*HardState) MarshalTo

func (m *HardState) MarshalTo(dAtA []byte) (int, error)

func (*HardState) ProtoMessage

func (*HardState) ProtoMessage()

func (*HardState) Reset

func (m *HardState) Reset()

func (*HardState) Size

func (m *HardState) Size() (n int)

func (*HardState) String

func (m *HardState) String() string

func (*HardState) Unmarshal

func (m *HardState) Unmarshal(dAtA []byte) error

type InstanceData

type InstanceData struct {
	Command *Command     `protobuf:"bytes,1,opt,name=command" json:"command,omitempty"`
	SeqNum  SeqNum       `protobuf:"varint,2,opt,name=seq_num,json=seqNum,proto3,casttype=SeqNum" json:"seq_num,omitempty"`
	Deps    []InstanceID `protobuf:"bytes,3,rep,name=deps" json:"deps"`
}

func (*InstanceData) Descriptor

func (*InstanceData) Descriptor() ([]byte, []int)

func (*InstanceData) GetCommand

func (m *InstanceData) GetCommand() *Command

func (*InstanceData) GetDeps

func (m *InstanceData) GetDeps() []InstanceID

func (*InstanceData) GetSeqNum

func (m *InstanceData) GetSeqNum() SeqNum

func (*InstanceData) Marshal

func (m *InstanceData) Marshal() (dAtA []byte, err error)

func (*InstanceData) MarshalTo

func (m *InstanceData) MarshalTo(dAtA []byte) (int, error)

func (*InstanceData) ProtoMessage

func (*InstanceData) ProtoMessage()

func (*InstanceData) Reset

func (m *InstanceData) Reset()

func (*InstanceData) Size

func (m *InstanceData) Size() (n int)

func (*InstanceData) String

func (m *InstanceData) String() string

func (*InstanceData) Unmarshal

func (m *InstanceData) Unmarshal(dAtA []byte) error

type InstanceID

type InstanceID struct {
	ReplicaID   ReplicaID   `protobuf:"varint,1,opt,name=replica_id,json=replicaId,proto3,casttype=ReplicaID" json:"replica_id,omitempty"`
	InstanceNum InstanceNum `protobuf:"varint,2,opt,name=instance_num,json=instanceNum,proto3,casttype=InstanceNum" json:"instance_num,omitempty"`
}

func (*InstanceID) Descriptor

func (*InstanceID) Descriptor() ([]byte, []int)

func (*InstanceID) GetInstanceNum

func (m *InstanceID) GetInstanceNum() InstanceNum

func (*InstanceID) GetReplicaID

func (m *InstanceID) GetReplicaID() ReplicaID

func (*InstanceID) Marshal

func (m *InstanceID) Marshal() (dAtA []byte, err error)

func (*InstanceID) MarshalTo

func (m *InstanceID) MarshalTo(dAtA []byte) (int, error)

func (*InstanceID) ProtoMessage

func (*InstanceID) ProtoMessage()

func (*InstanceID) Reset

func (m *InstanceID) Reset()

func (*InstanceID) Size

func (m *InstanceID) Size() (n int)

func (*InstanceID) String

func (m *InstanceID) String() string

func (*InstanceID) Unmarshal

func (m *InstanceID) Unmarshal(dAtA []byte) error

type InstanceIDs

type InstanceIDs []InstanceID

InstanceIDs is a slice of InstanceIDs.

func (InstanceIDs) Len

func (d InstanceIDs) Len() int

InstanceIDs implements the sort.Interface interface.

func (InstanceIDs) Less

func (d InstanceIDs) Less(i, j int) bool

func (InstanceIDs) Swap

func (d InstanceIDs) Swap(i, j int)

type InstanceNum

type InstanceNum uint64

InstanceNum is the number of an instance slot in a replica's command array.

func MaxInstanceNum

func MaxInstanceNum(a, b InstanceNum) InstanceNum

MaxInstanceNum returns the maximum Instance number.

type InstanceState

type InstanceState struct {
	InstanceID   `protobuf:"bytes,1,opt,name=meta,embedded=meta" json:"meta"`
	Status       InstanceState_Status `protobuf:"varint,2,opt,name=status,proto3,enum=epaxospb.InstanceState_Status" json:"status,omitempty"`
	InstanceData `protobuf:"bytes,3,opt,name=data,embedded=data" json:"data"`
	Ballot       *Ballot `protobuf:"bytes,4,opt,name=ballot" json:"ballot,omitempty"`
}

func (*InstanceState) Descriptor

func (*InstanceState) Descriptor() ([]byte, []int)

func (*InstanceState) GetBallot

func (m *InstanceState) GetBallot() *Ballot

func (*InstanceState) GetStatus

func (m *InstanceState) GetStatus() InstanceState_Status

func (*InstanceState) Less

func (ihs *InstanceState) Less(than btree.Item) bool

Less implements the btree.Item interface.

func (*InstanceState) Marshal

func (m *InstanceState) Marshal() (dAtA []byte, err error)

func (*InstanceState) MarshalTo

func (m *InstanceState) MarshalTo(dAtA []byte) (int, error)

func (*InstanceState) ProtoMessage

func (*InstanceState) ProtoMessage()

func (*InstanceState) Reset

func (m *InstanceState) Reset()

func (*InstanceState) Size

func (m *InstanceState) Size() (n int)

func (*InstanceState) String

func (m *InstanceState) String() string

func (*InstanceState) Unmarshal

func (m *InstanceState) Unmarshal(dAtA []byte) error

type InstanceState_Status

type InstanceState_Status int32
const (
	InstanceState_None        InstanceState_Status = 0
	InstanceState_PreAccepted InstanceState_Status = 1
	InstanceState_Accepted    InstanceState_Status = 2
	InstanceState_Committed   InstanceState_Status = 3
	InstanceState_Executed    InstanceState_Status = 4
)

func (InstanceState_Status) EnumDescriptor

func (InstanceState_Status) EnumDescriptor() ([]byte, []int)

func (InstanceState_Status) String

func (x InstanceState_Status) String() string

type Key

type Key []byte

Key is an abstract key in a keyspace.

func (Key) Compare

func (k Key) Compare(k2 Key) int

Compare compares the two Keys. The result will be 0 if k == k2, -1 if k < k2, and +1 if k > k2.

func (Key) Equal

func (k Key) Equal(o Key) bool

Equal returns whether two Keys are identical.

func (Key) String

func (k Key) String() string

String returns a string-formatted version of the Key.

type Message

type Message struct {
	// to is the destination of the message.
	To ReplicaID `protobuf:"varint,1,opt,name=to,proto3,casttype=ReplicaID" json:"to,omitempty"`
	// ballot is the message's ballot number.
	Ballot Ballot `protobuf:"bytes,2,opt,name=ballot" json:"ballot"`
	// instance_meta holds information of the message's corresponding instance.
	InstanceID InstanceID `protobuf:"bytes,3,opt,name=instance_id,json=instanceId" json:"instance_id"`
	// type is a union of different message types.
	//
	// Types that are valid to be assigned to Type:
	//	*Message_PreAccept
	//	*Message_PreAcceptOk
	//	*Message_PreAcceptReply
	//	*Message_Accept
	//	*Message_AcceptOk
	//	*Message_Commit
	Type isMessage_Type `protobuf_oneof:"type"`
}

func WrapMessage

func WrapMessage(msg proto.Message) Message

WrapMessage wraps a union type of Message in a new Message without a destination.

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetAccept

func (m *Message) GetAccept() *Accept

func (*Message) GetAcceptOk

func (m *Message) GetAcceptOk() *AcceptOK

func (*Message) GetBallot

func (m *Message) GetBallot() Ballot

func (*Message) GetCommit

func (m *Message) GetCommit() *Commit

func (*Message) GetInstanceID

func (m *Message) GetInstanceID() InstanceID

func (*Message) GetPreAccept

func (m *Message) GetPreAccept() *PreAccept

func (*Message) GetPreAcceptOk

func (m *Message) GetPreAcceptOk() *PreAcceptOK

func (*Message) GetPreAcceptReply

func (m *Message) GetPreAcceptReply() *PreAcceptReply

func (*Message) GetTo

func (m *Message) GetTo() ReplicaID

func (*Message) GetType

func (m *Message) GetType() isMessage_Type

func (*Message) Marshal

func (m *Message) Marshal() (dAtA []byte, err error)

func (*Message) MarshalTo

func (m *Message) MarshalTo(dAtA []byte) (int, error)

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) Size

func (m *Message) Size() (n int)

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(dAtA []byte) error

func (Message) WithDestination

func (msg Message) WithDestination(dest ReplicaID) Message

WithDestination returns the message with the provided destination.

func (*Message) XXX_OneofFuncs

func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Message_Accept

type Message_Accept struct {
	Accept *Accept `protobuf:"bytes,7,opt,name=accept,oneof"`
}

func (*Message_Accept) MarshalTo

func (m *Message_Accept) MarshalTo(dAtA []byte) (int, error)

func (*Message_Accept) Size

func (m *Message_Accept) Size() (n int)

type Message_AcceptOk

type Message_AcceptOk struct {
	AcceptOk *AcceptOK `protobuf:"bytes,8,opt,name=accept_ok,json=acceptOk,oneof"`
}

func (*Message_AcceptOk) MarshalTo

func (m *Message_AcceptOk) MarshalTo(dAtA []byte) (int, error)

func (*Message_AcceptOk) Size

func (m *Message_AcceptOk) Size() (n int)

type Message_Commit

type Message_Commit struct {
	Commit *Commit `protobuf:"bytes,9,opt,name=commit,oneof"`
}

func (*Message_Commit) MarshalTo

func (m *Message_Commit) MarshalTo(dAtA []byte) (int, error)

func (*Message_Commit) Size

func (m *Message_Commit) Size() (n int)

type Message_PreAccept

type Message_PreAccept struct {
	PreAccept *PreAccept `protobuf:"bytes,4,opt,name=pre_accept,json=preAccept,oneof"`
}

func (*Message_PreAccept) MarshalTo

func (m *Message_PreAccept) MarshalTo(dAtA []byte) (int, error)

func (*Message_PreAccept) Size

func (m *Message_PreAccept) Size() (n int)

type Message_PreAcceptOk

type Message_PreAcceptOk struct {
	PreAcceptOk *PreAcceptOK `protobuf:"bytes,5,opt,name=pre_accept_ok,json=preAcceptOk,oneof"`
}

func (*Message_PreAcceptOk) MarshalTo

func (m *Message_PreAcceptOk) MarshalTo(dAtA []byte) (int, error)

func (*Message_PreAcceptOk) Size

func (m *Message_PreAcceptOk) Size() (n int)

type Message_PreAcceptReply

type Message_PreAcceptReply struct {
	PreAcceptReply *PreAcceptReply `protobuf:"bytes,6,opt,name=pre_accept_reply,json=preAcceptReply,oneof"`
}

func (*Message_PreAcceptReply) MarshalTo

func (m *Message_PreAcceptReply) MarshalTo(dAtA []byte) (int, error)

func (*Message_PreAcceptReply) Size

func (m *Message_PreAcceptReply) Size() (n int)

type PreAccept

type PreAccept struct {
	InstanceData `protobuf:"bytes,1,opt,name=data,embedded=data" json:"data"`
}

func (*PreAccept) Descriptor

func (*PreAccept) Descriptor() ([]byte, []int)

func (*PreAccept) Marshal

func (m *PreAccept) Marshal() (dAtA []byte, err error)

func (*PreAccept) MarshalTo

func (m *PreAccept) MarshalTo(dAtA []byte) (int, error)

func (*PreAccept) ProtoMessage

func (*PreAccept) ProtoMessage()

func (*PreAccept) Reset

func (m *PreAccept) Reset()

func (*PreAccept) Size

func (m *PreAccept) Size() (n int)

func (*PreAccept) String

func (m *PreAccept) String() string

func (*PreAccept) Unmarshal

func (m *PreAccept) Unmarshal(dAtA []byte) error

type PreAcceptOK

type PreAcceptOK struct {
}

PreAcceptOK is used to respond to a PreAccept message is cases where the remote replica has no new information about the proposed command.

func (*PreAcceptOK) Descriptor

func (*PreAcceptOK) Descriptor() ([]byte, []int)

func (*PreAcceptOK) Marshal

func (m *PreAcceptOK) Marshal() (dAtA []byte, err error)

func (*PreAcceptOK) MarshalTo

func (m *PreAcceptOK) MarshalTo(dAtA []byte) (int, error)

func (*PreAcceptOK) ProtoMessage

func (*PreAcceptOK) ProtoMessage()

func (*PreAcceptOK) Reset

func (m *PreAcceptOK) Reset()

func (*PreAcceptOK) Size

func (m *PreAcceptOK) Size() (n int)

func (*PreAcceptOK) String

func (m *PreAcceptOK) String() string

func (*PreAcceptOK) Unmarshal

func (m *PreAcceptOK) Unmarshal(dAtA []byte) error

type PreAcceptReply

type PreAcceptReply struct {
	UpdatedSeqNum SeqNum       `protobuf:"varint,1,opt,name=updated_seq_num,json=updatedSeqNum,proto3,casttype=SeqNum" json:"updated_seq_num,omitempty"`
	UpdatedDeps   []InstanceID `protobuf:"bytes,2,rep,name=updated_deps,json=updatedDeps" json:"updated_deps"`
}

PreAcceptReply is used to respond to a PreAccept message in cases whe the remote replica has new information about the proposed command. This new information may either be a larger sequence number or extra dependencies.

func (*PreAcceptReply) Descriptor

func (*PreAcceptReply) Descriptor() ([]byte, []int)

func (*PreAcceptReply) GetUpdatedDeps

func (m *PreAcceptReply) GetUpdatedDeps() []InstanceID

func (*PreAcceptReply) GetUpdatedSeqNum

func (m *PreAcceptReply) GetUpdatedSeqNum() SeqNum

func (*PreAcceptReply) Marshal

func (m *PreAcceptReply) Marshal() (dAtA []byte, err error)

func (*PreAcceptReply) MarshalTo

func (m *PreAcceptReply) MarshalTo(dAtA []byte) (int, error)

func (*PreAcceptReply) ProtoMessage

func (*PreAcceptReply) ProtoMessage()

func (*PreAcceptReply) Reset

func (m *PreAcceptReply) Reset()

func (*PreAcceptReply) Size

func (m *PreAcceptReply) Size() (n int)

func (*PreAcceptReply) String

func (m *PreAcceptReply) String() string

func (*PreAcceptReply) Unmarshal

func (m *PreAcceptReply) Unmarshal(dAtA []byte) error

type ReplicaID

type ReplicaID uint64

ReplicaID is the id of a replica in an EPaxos deployment.

type SeqNum

type SeqNum uint64

SeqNum is a sequence number of an instance used to break ties when executing strongly connected command components. Essentially a Lamport logical clock.

func MaxSeqNum

func MaxSeqNum(a, b SeqNum) SeqNum

MaxSeqNum returns the maximum sequence number.

type Span

type Span struct {
	// The key for request. If the request operates on a range, this
	// represents the starting key for the range.
	Key Key `protobuf:"bytes,1,opt,name=key,proto3,casttype=Key" json:"key,omitempty"`
	// The end key is empty if the request spans only a single key. Otherwise,
	// it must order strictly after Key. In such a case, the header indicates
	// that the operation takes place on the key range from Key to EndKey,
	// including Key and excluding EndKey.
	EndKey Key `protobuf:"bytes,2,opt,name=end_key,json=endKey,proto3,casttype=Key" json:"end_key,omitempty"`
}

Span represents a span of Keys that a Command operates on.

func (*Span) Descriptor

func (*Span) Descriptor() ([]byte, []int)

func (Span) Equal

func (s Span) Equal(o Span) bool

Equal compares Spans for equality.

func (*Span) GetEndKey

func (m *Span) GetEndKey() Key

func (*Span) GetKey

func (m *Span) GetKey() Key

func (*Span) Marshal

func (m *Span) Marshal() (dAtA []byte, err error)

func (*Span) MarshalTo

func (m *Span) MarshalTo(dAtA []byte) (int, error)

func (Span) Overlaps

func (s Span) Overlaps(o Span) bool

Overlaps returns whether the two Spans overlap.

func (*Span) ProtoMessage

func (*Span) ProtoMessage()

func (*Span) Reset

func (m *Span) Reset()

func (*Span) Size

func (m *Span) Size() (n int)

func (Span) String

func (s Span) String() string

String returns a string-formatted version of the Span.

func (*Span) Unmarshal

func (m *Span) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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