raftpb

package
v0.0.0-...-01d9b8a Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRaftpb        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRaftpb          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRaftpb = fmt.Errorf("proto: unexpected end of group")
)
View Source
var PeerState_name = map[int32]string{
	0: "PeerNormal",
	1: "PeerApplying",
	2: "PeerTombstone",
}
View Source
var PeerState_value = map[string]int32{
	"PeerNormal":    0,
	"PeerApplying":  1,
	"PeerTombstone": 2,
}

Functions

This section is empty.

Types

type PeerState

type PeerState int32

PeerState the state of the shard peer

const (
	PeerNormal    PeerState = 0
	PeerApplying  PeerState = 1
	PeerTombstone PeerState = 2
)

func (PeerState) EnumDescriptor

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

func (PeerState) String

func (x PeerState) String() string

type RaftApplyState

type RaftApplyState struct {
	AppliedIndex   uint64             `protobuf:"varint,1,opt,name=appliedIndex,proto3" json:"appliedIndex,omitempty"`
	TruncatedState RaftTruncatedState `protobuf:"bytes,2,opt,name=truncatedState,proto3" json:"truncatedState"`
}

RaftApplyState raft log applied state

func (*RaftApplyState) Descriptor

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

func (*RaftApplyState) GetAppliedIndex

func (m *RaftApplyState) GetAppliedIndex() uint64

func (*RaftApplyState) GetTruncatedState

func (m *RaftApplyState) GetTruncatedState() RaftTruncatedState

func (*RaftApplyState) Marshal

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

func (*RaftApplyState) MarshalTo

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

func (*RaftApplyState) MarshalToSizedBuffer

func (m *RaftApplyState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RaftApplyState) ProtoMessage

func (*RaftApplyState) ProtoMessage()

func (*RaftApplyState) Reset

func (m *RaftApplyState) Reset()

func (*RaftApplyState) Size

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

func (*RaftApplyState) String

func (m *RaftApplyState) String() string

func (*RaftApplyState) Unmarshal

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

func (*RaftApplyState) XXX_DiscardUnknown

func (m *RaftApplyState) XXX_DiscardUnknown()

func (*RaftApplyState) XXX_Marshal

func (m *RaftApplyState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RaftApplyState) XXX_Merge

func (m *RaftApplyState) XXX_Merge(src proto.Message)

func (*RaftApplyState) XXX_Size

func (m *RaftApplyState) XXX_Size() int

func (*RaftApplyState) XXX_Unmarshal

func (m *RaftApplyState) XXX_Unmarshal(b []byte) error

type RaftLocalState

type RaftLocalState struct {
	HardState []byte `protobuf:"bytes,1,opt,name=hardState,proto3" json:"hardState,omitempty"`
	LastIndex uint64 `protobuf:"varint,2,opt,name=lastIndex,proto3" json:"lastIndex,omitempty"`
}

RaftLocalState raft local state about raft log

func (*RaftLocalState) Descriptor

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

func (*RaftLocalState) GetHardState

func (m *RaftLocalState) GetHardState() []byte

func (*RaftLocalState) GetLastIndex

func (m *RaftLocalState) GetLastIndex() uint64

func (*RaftLocalState) Marshal

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

func (*RaftLocalState) MarshalTo

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

func (*RaftLocalState) MarshalToSizedBuffer

func (m *RaftLocalState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RaftLocalState) ProtoMessage

func (*RaftLocalState) ProtoMessage()

func (*RaftLocalState) Reset

func (m *RaftLocalState) Reset()

func (*RaftLocalState) Size

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

func (*RaftLocalState) String

func (m *RaftLocalState) String() string

func (*RaftLocalState) Unmarshal

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

func (*RaftLocalState) XXX_DiscardUnknown

func (m *RaftLocalState) XXX_DiscardUnknown()

func (*RaftLocalState) XXX_Marshal

func (m *RaftLocalState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RaftLocalState) XXX_Merge

func (m *RaftLocalState) XXX_Merge(src proto.Message)

func (*RaftLocalState) XXX_Size

func (m *RaftLocalState) XXX_Size() int

func (*RaftLocalState) XXX_Unmarshal

func (m *RaftLocalState) XXX_Unmarshal(b []byte) error

type RaftMessage

type RaftMessage struct {
	ShardID         uint64            `protobuf:"varint,1,opt,name=shardID,proto3" json:"shardID,omitempty"`
	Group           uint64            `protobuf:"varint,2,opt,name=group,proto3" json:"group,omitempty"`
	From            metapb.Peer       `protobuf:"bytes,3,opt,name=from,proto3" json:"from"`
	To              metapb.Peer       `protobuf:"bytes,4,opt,name=to,proto3" json:"to"`
	Message         []byte            `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
	ShardEpoch      metapb.ShardEpoch `protobuf:"bytes,6,opt,name=shardEpoch,proto3" json:"shardEpoch"`
	IsTombstone     bool              `protobuf:"varint,7,opt,name=isTombstone,proto3" json:"isTombstone,omitempty"`
	Start           []byte            `protobuf:"bytes,8,opt,name=start,proto3" json:"start,omitempty"`
	End             []byte            `protobuf:"bytes,9,opt,name=end,proto3" json:"end,omitempty"`
	DisableSplit    bool              `protobuf:"varint,10,opt,name=disableSplit,proto3" json:"disableSplit,omitempty"`
	Data            []byte            `protobuf:"bytes,11,opt,name=data,proto3" json:"data,omitempty"`
	DataAppendToMsg bool              `protobuf:"varint,12,opt,name=dataAppendToMsg,proto3" json:"dataAppendToMsg,omitempty"`
}

RaftMessage the message wrapped raft msg with shard info

func (*RaftMessage) Descriptor

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

func (*RaftMessage) GetData

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

func (*RaftMessage) GetDataAppendToMsg

func (m *RaftMessage) GetDataAppendToMsg() bool

func (*RaftMessage) GetDisableSplit

func (m *RaftMessage) GetDisableSplit() bool

func (*RaftMessage) GetEnd

func (m *RaftMessage) GetEnd() []byte

func (*RaftMessage) GetFrom

func (m *RaftMessage) GetFrom() metapb.Peer

func (*RaftMessage) GetGroup

func (m *RaftMessage) GetGroup() uint64

func (*RaftMessage) GetIsTombstone

func (m *RaftMessage) GetIsTombstone() bool

func (*RaftMessage) GetMessage

func (m *RaftMessage) GetMessage() []byte

func (*RaftMessage) GetShardEpoch

func (m *RaftMessage) GetShardEpoch() metapb.ShardEpoch

func (*RaftMessage) GetShardID

func (m *RaftMessage) GetShardID() uint64

func (*RaftMessage) GetStart

func (m *RaftMessage) GetStart() []byte

func (*RaftMessage) GetTo

func (m *RaftMessage) GetTo() metapb.Peer

func (*RaftMessage) Marshal

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

func (*RaftMessage) MarshalTo

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

func (*RaftMessage) MarshalToSizedBuffer

func (m *RaftMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RaftMessage) ProtoMessage

func (*RaftMessage) ProtoMessage()

func (*RaftMessage) Reset

func (m *RaftMessage) Reset()

func (*RaftMessage) Size

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

func (*RaftMessage) String

func (m *RaftMessage) String() string

func (*RaftMessage) Unmarshal

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

func (*RaftMessage) XXX_DiscardUnknown

func (m *RaftMessage) XXX_DiscardUnknown()

func (*RaftMessage) XXX_Marshal

func (m *RaftMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RaftMessage) XXX_Merge

func (m *RaftMessage) XXX_Merge(src proto.Message)

func (*RaftMessage) XXX_Size

func (m *RaftMessage) XXX_Size() int

func (*RaftMessage) XXX_Unmarshal

func (m *RaftMessage) XXX_Unmarshal(b []byte) error

type RaftTruncatedState

type RaftTruncatedState struct {
	Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Term  uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
}

RaftTruncatedState raft log truncated state

func (*RaftTruncatedState) Descriptor

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

func (*RaftTruncatedState) GetIndex

func (m *RaftTruncatedState) GetIndex() uint64

func (*RaftTruncatedState) GetTerm

func (m *RaftTruncatedState) GetTerm() uint64

func (*RaftTruncatedState) Marshal

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

func (*RaftTruncatedState) MarshalTo

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

func (*RaftTruncatedState) MarshalToSizedBuffer

func (m *RaftTruncatedState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RaftTruncatedState) ProtoMessage

func (*RaftTruncatedState) ProtoMessage()

func (*RaftTruncatedState) Reset

func (m *RaftTruncatedState) Reset()

func (*RaftTruncatedState) Size

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

func (*RaftTruncatedState) String

func (m *RaftTruncatedState) String() string

func (*RaftTruncatedState) Unmarshal

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

func (*RaftTruncatedState) XXX_DiscardUnknown

func (m *RaftTruncatedState) XXX_DiscardUnknown()

func (*RaftTruncatedState) XXX_Marshal

func (m *RaftTruncatedState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RaftTruncatedState) XXX_Merge

func (m *RaftTruncatedState) XXX_Merge(src proto.Message)

func (*RaftTruncatedState) XXX_Size

func (m *RaftTruncatedState) XXX_Size() int

func (*RaftTruncatedState) XXX_Unmarshal

func (m *RaftTruncatedState) XXX_Unmarshal(b []byte) error

type ShardLocalState

type ShardLocalState struct {
	State PeerState    `protobuf:"varint,1,opt,name=state,proto3,enum=raftpb.PeerState" json:"state,omitempty"`
	Shard metapb.Shard `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard"`
}

ShardLocalState the shard state on the store

func (*ShardLocalState) Descriptor

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

func (*ShardLocalState) GetShard

func (m *ShardLocalState) GetShard() metapb.Shard

func (*ShardLocalState) GetState

func (m *ShardLocalState) GetState() PeerState

func (*ShardLocalState) Marshal

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

func (*ShardLocalState) MarshalTo

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

func (*ShardLocalState) MarshalToSizedBuffer

func (m *ShardLocalState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ShardLocalState) ProtoMessage

func (*ShardLocalState) ProtoMessage()

func (*ShardLocalState) Reset

func (m *ShardLocalState) Reset()

func (*ShardLocalState) Size

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

func (*ShardLocalState) String

func (m *ShardLocalState) String() string

func (*ShardLocalState) Unmarshal

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

func (*ShardLocalState) XXX_DiscardUnknown

func (m *ShardLocalState) XXX_DiscardUnknown()

func (*ShardLocalState) XXX_Marshal

func (m *ShardLocalState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShardLocalState) XXX_Merge

func (m *ShardLocalState) XXX_Merge(src proto.Message)

func (*ShardLocalState) XXX_Size

func (m *ShardLocalState) XXX_Size() int

func (*ShardLocalState) XXX_Unmarshal

func (m *ShardLocalState) XXX_Unmarshal(b []byte) error

type SnapshotMessage

type SnapshotMessage struct {
	Header   SnapshotMessageHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
	Data     []byte                `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	First    bool                  `protobuf:"varint,3,opt,name=first,proto3" json:"first,omitempty"`
	Last     bool                  `protobuf:"varint,4,opt,name=last,proto3" json:"last,omitempty"`
	FileSize uint64                `protobuf:"varint,5,opt,name=fileSize,proto3" json:"fileSize,omitempty"`
	CheckSum uint64                `protobuf:"varint,6,opt,name=checkSum,proto3" json:"checkSum,omitempty"`
}

SnapshotMessage snapshot message

func (*SnapshotMessage) Descriptor

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

func (*SnapshotMessage) GetCheckSum

func (m *SnapshotMessage) GetCheckSum() uint64

func (*SnapshotMessage) GetData

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

func (*SnapshotMessage) GetFileSize

func (m *SnapshotMessage) GetFileSize() uint64

func (*SnapshotMessage) GetFirst

func (m *SnapshotMessage) GetFirst() bool

func (*SnapshotMessage) GetHeader

func (m *SnapshotMessage) GetHeader() SnapshotMessageHeader

func (*SnapshotMessage) GetLast

func (m *SnapshotMessage) GetLast() bool

func (*SnapshotMessage) Marshal

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

func (*SnapshotMessage) MarshalTo

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

func (*SnapshotMessage) MarshalToSizedBuffer

func (m *SnapshotMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SnapshotMessage) ProtoMessage

func (*SnapshotMessage) ProtoMessage()

func (*SnapshotMessage) Reset

func (m *SnapshotMessage) Reset()

func (*SnapshotMessage) Size

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

func (*SnapshotMessage) String

func (m *SnapshotMessage) String() string

func (*SnapshotMessage) Unmarshal

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

func (*SnapshotMessage) XXX_DiscardUnknown

func (m *SnapshotMessage) XXX_DiscardUnknown()

func (*SnapshotMessage) XXX_Marshal

func (m *SnapshotMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SnapshotMessage) XXX_Merge

func (m *SnapshotMessage) XXX_Merge(src proto.Message)

func (*SnapshotMessage) XXX_Size

func (m *SnapshotMessage) XXX_Size() int

func (*SnapshotMessage) XXX_Unmarshal

func (m *SnapshotMessage) XXX_Unmarshal(b []byte) error

type SnapshotMessageHeader

type SnapshotMessageHeader struct {
	Shard metapb.Shard `protobuf:"bytes,1,opt,name=shard,proto3" json:"shard"`
	From  metapb.Peer  `protobuf:"bytes,2,opt,name=from,proto3" json:"from"`
	To    metapb.Peer  `protobuf:"bytes,3,opt,name=to,proto3" json:"to"`
	Term  uint64       `protobuf:"varint,4,opt,name=term,proto3" json:"term,omitempty"`
	Index uint64       `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"`
}

SnapshotMessageHeader snapshot message header

func (*SnapshotMessageHeader) Descriptor

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

func (*SnapshotMessageHeader) GetFrom

func (m *SnapshotMessageHeader) GetFrom() metapb.Peer

func (*SnapshotMessageHeader) GetIndex

func (m *SnapshotMessageHeader) GetIndex() uint64

func (*SnapshotMessageHeader) GetShard

func (m *SnapshotMessageHeader) GetShard() metapb.Shard

func (*SnapshotMessageHeader) GetTerm

func (m *SnapshotMessageHeader) GetTerm() uint64

func (*SnapshotMessageHeader) GetTo

func (m *SnapshotMessageHeader) GetTo() metapb.Peer

func (*SnapshotMessageHeader) Marshal

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

func (*SnapshotMessageHeader) MarshalTo

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

func (*SnapshotMessageHeader) MarshalToSizedBuffer

func (m *SnapshotMessageHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SnapshotMessageHeader) ProtoMessage

func (*SnapshotMessageHeader) ProtoMessage()

func (*SnapshotMessageHeader) Reset

func (m *SnapshotMessageHeader) Reset()

func (*SnapshotMessageHeader) Size

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

func (*SnapshotMessageHeader) String

func (m *SnapshotMessageHeader) String() string

func (*SnapshotMessageHeader) Unmarshal

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

func (*SnapshotMessageHeader) XXX_DiscardUnknown

func (m *SnapshotMessageHeader) XXX_DiscardUnknown()

func (*SnapshotMessageHeader) XXX_Marshal

func (m *SnapshotMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SnapshotMessageHeader) XXX_Merge

func (m *SnapshotMessageHeader) XXX_Merge(src proto.Message)

func (*SnapshotMessageHeader) XXX_Size

func (m *SnapshotMessageHeader) XXX_Size() int

func (*SnapshotMessageHeader) XXX_Unmarshal

func (m *SnapshotMessageHeader) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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