raftpb

package
v3.3.102 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoNode is the flag used to indicate that the node id field is not set.
	NoNode uint64 = 0
)
View Source
const (
	// RaftEntryEncodingScheme is the scheme name of the codec.
	RaftEntryEncodingScheme = "colfer"
)

Variables

View Source
var (
	// LastChunkCount is the special chunk count value used to indicate that the
	// chunk is the last one.
	LastChunkCount uint64 = math.MaxUint64
	// PoisonChunkCount is the special chunk count value used to indicate that
	// the processing goroutine should return.
	PoisonChunkCount uint64 = math.MaxUint64 - 1
)
View Source
var (
	ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRaft   = fmt.Errorf("proto: integer overflow")
)
View Source
var ChecksumType_name = map[int32]string{
	0: "CRC32IEEE",
	1: "HIGHWAY",
}
View Source
var ChecksumType_value = map[string]int32{
	"CRC32IEEE": 0,
	"HIGHWAY":   1,
}
View Source
var (
	// ColferSizeMax is the upper limit for serial byte sizes
	ColferSizeMax uint64 = 8 * 1024 * 1024 * 1024 * 1024
)

Colfer configuration attributes

View Source
var CompressionType_name = map[int32]string{
	0: "NoCompression",
	1: "Snappy",
}
View Source
var CompressionType_value = map[string]int32{
	"NoCompression": 0,
	"Snappy":        1,
}
View Source
var ConfigChangeType_name = map[int32]string{
	0: "AddNode",
	1: "RemoveNode",
	2: "AddObserver",
	3: "AddWitness",
}
View Source
var ConfigChangeType_value = map[string]int32{
	"AddNode":     0,
	"RemoveNode":  1,
	"AddObserver": 2,
	"AddWitness":  3,
}
View Source
var EntryType_name = map[int32]string{
	0: "ApplicationEntry",
	1: "ConfigChangeEntry",
	2: "EncodedEntry",
	3: "MetadataEntry",
}
View Source
var EntryType_value = map[string]int32{
	"ApplicationEntry":  0,
	"ConfigChangeEntry": 1,
	"EncodedEntry":      2,
	"MetadataEntry":     3,
}
View Source
var MessageType_name = map[int32]string{
	0:  "LocalTick",
	1:  "Election",
	2:  "LeaderHeartbeat",
	3:  "ConfigChangeEvent",
	4:  "NoOP",
	5:  "Ping",
	6:  "Pong",
	7:  "Propose",
	8:  "SnapshotStatus",
	9:  "Unreachable",
	10: "CheckQuorum",
	11: "BatchedReadIndex",
	12: "Replicate",
	13: "ReplicateResp",
	14: "RequestVote",
	15: "RequestVoteResp",
	16: "InstallSnapshot",
	17: "Heartbeat",
	18: "HeartbeatResp",
	19: "ReadIndex",
	20: "ReadIndexResp",
	21: "Quiesce",
	22: "SnapshotReceived",
	23: "LeaderTransfer",
	24: "TimeoutNow",
	25: "RateLimit",
}
View Source
var MessageType_value = map[string]int32{
	"LocalTick":         0,
	"Election":          1,
	"LeaderHeartbeat":   2,
	"ConfigChangeEvent": 3,
	"NoOP":              4,
	"Ping":              5,
	"Pong":              6,
	"Propose":           7,
	"SnapshotStatus":    8,
	"Unreachable":       9,
	"CheckQuorum":       10,
	"BatchedReadIndex":  11,
	"Replicate":         12,
	"ReplicateResp":     13,
	"RequestVote":       14,
	"RequestVoteResp":   15,
	"InstallSnapshot":   16,
	"Heartbeat":         17,
	"HeartbeatResp":     18,
	"ReadIndex":         19,
	"ReadIndexResp":     20,
	"Quiesce":           21,
	"SnapshotReceived":  22,
	"LeaderTransfer":    23,
	"TimeoutNow":        24,
	"RateLimit":         25,
}
View Source
var StateMachineType_name = map[int32]string{
	0: "UnknownStateMachine",
	1: "RegularStateMachine",
	2: "ConcurrentStateMachine",
	3: "OnDiskStateMachine",
}
View Source
var StateMachineType_value = map[string]int32{
	"UnknownStateMachine":    0,
	"RegularStateMachine":    1,
	"ConcurrentStateMachine": 2,
	"OnDiskStateMachine":     3,
}

Functions

func GetEntrySliceInMemSize

func GetEntrySliceInMemSize(ents []Entry) uint64

GetEntrySliceInMemSize returns the in memory size of the specified entry slice. Size 24 bytes used to hold ents itself is not counted.

func GetEntrySliceSize

func GetEntrySliceSize(ents []Entry) uint64

GetEntrySliceSize returns the upper limit of the entry slice size.

func IsEmptySnapshot

func IsEmptySnapshot(s Snapshot) bool

IsEmptySnapshot returns a boolean flag indicating whether the given snapshot is and empty dummy record.

func IsEmptyState

func IsEmptyState(st State) bool

IsEmptyState returns a boolean flag indicating whether the given State is empty.

func IsStateEqual

func IsStateEqual(a State, b State) bool

IsStateEqual returns whether two input state instances are equal.

Types

type Bootstrap

type Bootstrap struct {
	Addresses map[uint64]string `` /* 139-byte string literal not displayed */
	Join      bool              `protobuf:"varint,2,opt,name=join" json:"join"`
	Type      StateMachineType  `protobuf:"varint,3,opt,name=Type,enum=raftpb.StateMachineType" json:"Type"`
}

func NewBootstrapInfo

func NewBootstrapInfo(join bool,
	smType StateMachineType, nodes map[uint64]string) Bootstrap

NewBootstrapInfo creates and returns a new bootstrap record.

func (*Bootstrap) Descriptor

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

func (*Bootstrap) GetAddresses

func (m *Bootstrap) GetAddresses() map[uint64]string

func (*Bootstrap) GetJoin

func (m *Bootstrap) GetJoin() bool

func (*Bootstrap) GetType

func (m *Bootstrap) GetType() StateMachineType

func (*Bootstrap) Marshal

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

func (*Bootstrap) MarshalTo

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

func (*Bootstrap) ProtoMessage

func (*Bootstrap) ProtoMessage()

func (*Bootstrap) Reset

func (m *Bootstrap) Reset()

func (*Bootstrap) Size

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

func (*Bootstrap) String

func (m *Bootstrap) String() string

func (*Bootstrap) Unmarshal

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

func (*Bootstrap) Validate

func (b *Bootstrap) Validate(nodes map[uint64]string,
	join bool, smType StateMachineType) bool

Validate checks whether the incoming nodes parameter and the join flag is valid given the recorded bootstrap infomration in Log DB.

func (*Bootstrap) XXX_DiscardUnknown

func (m *Bootstrap) XXX_DiscardUnknown()

func (*Bootstrap) XXX_Marshal

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

func (*Bootstrap) XXX_Merge

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

func (*Bootstrap) XXX_Size

func (m *Bootstrap) XXX_Size() int

func (*Bootstrap) XXX_Unmarshal

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

type ChecksumType

type ChecksumType int32
const (
	CRC32IEEE ChecksumType = 0
	HIGHWAY   ChecksumType = 1
)

func (ChecksumType) Enum

func (x ChecksumType) Enum() *ChecksumType

func (ChecksumType) EnumDescriptor

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

func (ChecksumType) String

func (x ChecksumType) String() string

func (*ChecksumType) UnmarshalJSON

func (x *ChecksumType) UnmarshalJSON(data []byte) error

type Chunk

type Chunk struct {
	ClusterId      uint64       `protobuf:"varint,1,opt,name=cluster_id,json=clusterId" json:"cluster_id"`
	NodeId         uint64       `protobuf:"varint,2,opt,name=node_id,json=nodeId" json:"node_id"`
	From           uint64       `protobuf:"varint,3,opt,name=from" json:"from"`
	ChunkId        uint64       `protobuf:"varint,4,opt,name=chunk_id,json=chunkId" json:"chunk_id"`
	ChunkSize      uint64       `protobuf:"varint,5,opt,name=chunk_size,json=chunkSize" json:"chunk_size"`
	ChunkCount     uint64       `protobuf:"varint,6,opt,name=chunk_count,json=chunkCount" json:"chunk_count"`
	Data           []byte       `protobuf:"bytes,7,opt,name=data" json:"data"`
	Index          uint64       `protobuf:"varint,8,opt,name=index" json:"index"`
	Term           uint64       `protobuf:"varint,9,opt,name=term" json:"term"`
	Membership     Membership   `protobuf:"bytes,10,opt,name=membership" json:"membership"`
	Filepath       string       `protobuf:"bytes,12,opt,name=filepath" json:"filepath"`
	FileSize       uint64       `protobuf:"varint,13,opt,name=file_size,json=fileSize" json:"file_size"`
	DeploymentId   uint64       `protobuf:"varint,14,opt,name=deployment_id,json=deploymentId" json:"deployment_id"`
	FileChunkId    uint64       `protobuf:"varint,15,opt,name=file_chunk_id,json=fileChunkId" json:"file_chunk_id"`
	FileChunkCount uint64       `protobuf:"varint,16,opt,name=file_chunk_count,json=fileChunkCount" json:"file_chunk_count"`
	HasFileInfo    bool         `protobuf:"varint,17,opt,name=has_file_info,json=hasFileInfo" json:"has_file_info"`
	FileInfo       SnapshotFile `protobuf:"bytes,18,opt,name=file_info,json=fileInfo" json:"file_info"`
	BinVer         uint32       `protobuf:"varint,19,opt,name=bin_ver,json=binVer" json:"bin_ver"`
	OnDiskIndex    uint64       `protobuf:"varint,20,opt,name=on_disk_index,json=onDiskIndex" json:"on_disk_index"`
	Witness        bool         `protobuf:"varint,21,opt,name=witness" json:"witness"`
}

field id 11 was used for optional string filename

func (*Chunk) Descriptor

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

func (*Chunk) GetBinVer

func (m *Chunk) GetBinVer() uint32

func (*Chunk) GetChunkCount

func (m *Chunk) GetChunkCount() uint64

func (*Chunk) GetChunkId

func (m *Chunk) GetChunkId() uint64

func (*Chunk) GetChunkSize

func (m *Chunk) GetChunkSize() uint64

func (*Chunk) GetClusterId

func (m *Chunk) GetClusterId() uint64

func (*Chunk) GetData

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

func (*Chunk) GetDeploymentId

func (m *Chunk) GetDeploymentId() uint64

func (*Chunk) GetFileChunkCount

func (m *Chunk) GetFileChunkCount() uint64

func (*Chunk) GetFileChunkId

func (m *Chunk) GetFileChunkId() uint64

func (*Chunk) GetFileInfo

func (m *Chunk) GetFileInfo() SnapshotFile

func (*Chunk) GetFileSize

func (m *Chunk) GetFileSize() uint64

func (*Chunk) GetFilepath

func (m *Chunk) GetFilepath() string

func (*Chunk) GetFrom

func (m *Chunk) GetFrom() uint64

func (*Chunk) GetHasFileInfo

func (m *Chunk) GetHasFileInfo() bool

func (*Chunk) GetIndex

func (m *Chunk) GetIndex() uint64

func (*Chunk) GetMembership

func (m *Chunk) GetMembership() Membership

func (*Chunk) GetNodeId

func (m *Chunk) GetNodeId() uint64

func (*Chunk) GetOnDiskIndex

func (m *Chunk) GetOnDiskIndex() uint64

func (*Chunk) GetTerm

func (m *Chunk) GetTerm() uint64

func (*Chunk) GetWitness

func (m *Chunk) GetWitness() bool

func (Chunk) IsLastChunk

func (c Chunk) IsLastChunk() bool

IsLastChunk returns a boolean value indicating whether the chunk is the last chunk of a snapshot.

func (Chunk) IsLastFileChunk

func (c Chunk) IsLastFileChunk() bool

IsLastFileChunk returns a boolean value indicating whether the chunk is the last chunk of a snapshot file.

func (Chunk) IsPoisonChunk

func (c Chunk) IsPoisonChunk() bool

IsPoisonChunk returns a boolean value indicating whether the chunk is a special poison chunk.

func (*Chunk) Marshal

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

func (*Chunk) MarshalTo

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

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) Reset

func (m *Chunk) Reset()

func (*Chunk) Size

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

func (*Chunk) String

func (m *Chunk) String() string

func (*Chunk) Unmarshal

func (m *Chunk) Unmarshal(dAtA []byte) error
func (m *MessageBatch) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowRaft
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: MessageBatch: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MessageBatch: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthRaft
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthRaft
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Requests = append(m.Requests, Message{})
			if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType)
			}
			m.DeploymentId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.DeploymentId |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field SourceAddress", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthRaft
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthRaft
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.SourceAddress = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field BinVer", wireType)
			}
			m.BinVer = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.BinVer |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipRaft(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthRaft
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthRaft
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}

func (*Chunk) XXX_DiscardUnknown

func (m *Chunk) XXX_DiscardUnknown()

func (*Chunk) XXX_Marshal

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

func (*Chunk) XXX_Merge

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

func (*Chunk) XXX_Size

func (m *Chunk) XXX_Size() int

func (*Chunk) XXX_Unmarshal

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

type ColferError

type ColferError int

ColferError signals a data mismatch as as a byte index.

func (ColferError) Error

func (i ColferError) Error() string

Error honors the error interface.

type ColferMax

type ColferMax string

ColferMax signals an upper limit breach.

func (ColferMax) Error

func (m ColferMax) Error() string

Error honors the error interface.

type ColferTail

type ColferTail int

ColferTail signals data continuation as a byte index.

func (ColferTail) Error

func (i ColferTail) Error() string

Error honors the error interface.

type CompressionType

type CompressionType int32
const (
	NoCompression CompressionType = 0
	Snappy        CompressionType = 1
)

func (CompressionType) Enum

func (x CompressionType) Enum() *CompressionType

func (CompressionType) EnumDescriptor

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

func (CompressionType) String

func (x CompressionType) String() string

func (*CompressionType) UnmarshalJSON

func (x *CompressionType) UnmarshalJSON(data []byte) error

type ConfigChange

type ConfigChange struct {
	ConfigChangeId uint64           `protobuf:"varint,1,opt,name=config_change_id,json=configChangeId" json:"config_change_id"`
	Type           ConfigChangeType `protobuf:"varint,2,opt,name=Type,enum=raftpb.ConfigChangeType" json:"Type"`
	NodeID         uint64           `protobuf:"varint,3,opt,name=NodeID" json:"NodeID"`
	Address        string           `protobuf:"bytes,4,opt,name=Address" json:"Address"`
	Initialize     bool             `protobuf:"varint,5,opt,name=Initialize" json:"Initialize"`
}

func (*ConfigChange) Descriptor

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

func (*ConfigChange) GetAddress

func (m *ConfigChange) GetAddress() string

func (*ConfigChange) GetConfigChangeId

func (m *ConfigChange) GetConfigChangeId() uint64

func (*ConfigChange) GetInitialize

func (m *ConfigChange) GetInitialize() bool

func (*ConfigChange) GetNodeID

func (m *ConfigChange) GetNodeID() uint64

func (*ConfigChange) GetType

func (m *ConfigChange) GetType() ConfigChangeType

func (*ConfigChange) Marshal

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

func (*ConfigChange) MarshalTo

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

func (*ConfigChange) ProtoMessage

func (*ConfigChange) ProtoMessage()

func (*ConfigChange) Reset

func (m *ConfigChange) Reset()

func (*ConfigChange) Size

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

func (*ConfigChange) String

func (m *ConfigChange) String() string

func (*ConfigChange) Unmarshal

func (m *ConfigChange) Unmarshal(dAtA []byte) error
func (m *Message) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowRaft
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Message: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
			}
			m.Type = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Type |= MessageType(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
			}
			m.To = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.To |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
			}
			m.From = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.From |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType)
			}
			m.ClusterId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ClusterId |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			m.Term = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Term |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 6:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType)
			}
			m.LogTerm = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.LogTerm |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 7:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field LogIndex", wireType)
			}
			m.LogIndex = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.LogIndex |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 8:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
			}
			m.Commit = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Commit |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 9:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Reject = bool(v != 0)
		case 10:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType)
			}
			m.Hint = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Hint |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 11:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthRaft
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthRaft
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Entries = append(m.Entries, Entry{})
			if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 12:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthRaft
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthRaft
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 13:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field HintHigh", wireType)
			}
			m.HintHigh = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.HintHigh |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipRaft(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthRaft
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthRaft
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}

func (*ConfigChange) XXX_DiscardUnknown

func (m *ConfigChange) XXX_DiscardUnknown()

func (*ConfigChange) XXX_Marshal

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

func (*ConfigChange) XXX_Merge

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

func (*ConfigChange) XXX_Size

func (m *ConfigChange) XXX_Size() int

func (*ConfigChange) XXX_Unmarshal

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

type ConfigChangeType

type ConfigChangeType int32
const (
	AddNode     ConfigChangeType = 0
	RemoveNode  ConfigChangeType = 1
	AddObserver ConfigChangeType = 2
	AddWitness  ConfigChangeType = 3
)

func (ConfigChangeType) Enum

func (ConfigChangeType) EnumDescriptor

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

func (ConfigChangeType) String

func (x ConfigChangeType) String() string

func (*ConfigChangeType) UnmarshalJSON

func (x *ConfigChangeType) UnmarshalJSON(data []byte) error

type Entry

type Entry struct {
	Term        uint64    `protobuf:"varint,1,opt,name=Term" json:"Term"`
	Index       uint64    `protobuf:"varint,2,opt,name=Index" json:"Index"`
	Type        EntryType `protobuf:"varint,3,opt,name=Type,enum=raftpb.EntryType" json:"Type"`
	Key         uint64    `protobuf:"varint,4,opt,name=Key" json:"Key"`
	ClientID    uint64    `protobuf:"varint,5,opt,name=ClientID" json:"ClientID"`
	SeriesID    uint64    `protobuf:"varint,6,opt,name=SeriesID" json:"SeriesID"`
	RespondedTo uint64    `protobuf:"varint,7,opt,name=RespondedTo" json:"RespondedTo"`
	Cmd         []byte    `protobuf:"bytes,8,opt,name=Cmd" json:"Cmd"`
}

func (*Entry) Descriptor

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

func (*Entry) GetClientID

func (m *Entry) GetClientID() uint64

func (*Entry) GetCmd

func (m *Entry) GetCmd() []byte

func (*Entry) GetIndex

func (m *Entry) GetIndex() uint64

func (*Entry) GetKey

func (m *Entry) GetKey() uint64

func (*Entry) GetRespondedTo

func (m *Entry) GetRespondedTo() uint64

func (*Entry) GetSeriesID

func (m *Entry) GetSeriesID() uint64

func (*Entry) GetTerm

func (m *Entry) GetTerm() uint64

func (*Entry) GetType

func (m *Entry) GetType() EntryType

func (*Entry) IsConfigChange

func (e *Entry) IsConfigChange() bool

IsConfigChange returns a boolean value indicating whether the entry is for config change.

func (*Entry) IsEmpty

func (e *Entry) IsEmpty() bool

IsEmpty returns a boolean value indicating whether the entry is Empty.

func (*Entry) IsEndOfSessionRequest

func (e *Entry) IsEndOfSessionRequest() bool

IsEndOfSessionRequest returns a boolean value indicating whether the entry is for requesting the session to come to an end.

func (*Entry) IsNewSessionRequest

func (e *Entry) IsNewSessionRequest() bool

IsNewSessionRequest returns a boolean value indicating whether the entry is for reqeusting a new client.

func (*Entry) IsNoOPSession

func (e *Entry) IsNoOPSession() bool

IsNoOPSession returns a boolean value indicating whether the entry is NoOP session managed.

func (*Entry) IsProposal

func (e *Entry) IsProposal() bool

IsProposal returns a boolean value indicating whether the entry is a regular update entry.

func (*Entry) IsSessionManaged

func (e *Entry) IsSessionManaged() bool

IsSessionManaged returns a boolean value indicating whether the entry is session managed.

func (*Entry) IsUpdateEntry

func (e *Entry) IsUpdateEntry() bool

IsUpdateEntry returns a boolean flag indicating whether the entry is a regular application entry not used for session management.

func (*Entry) Marshal

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

func (*Entry) MarshalTo

func (o *Entry) MarshalTo(buf []byte) (int, error)

MarshalTo marshals the entry to the specified byte slice.

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (m *Entry) Reset()

func (*Entry) Size

func (o *Entry) Size() int

Size returns the actual size of an entry

func (*Entry) SizeUpperLimit

func (o *Entry) SizeUpperLimit() int

SizeUpperLimit returns the upper limit size of an entry.

func (*Entry) String

func (m *Entry) String() string

func (*Entry) Unmarshal

func (o *Entry) Unmarshal(data []byte) error

Unmarshal unmarshals the input to the current entry instance.

func (*Entry) XXX_DiscardUnknown

func (m *Entry) XXX_DiscardUnknown()

func (*Entry) XXX_Marshal

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

func (*Entry) XXX_Merge

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

func (*Entry) XXX_Size

func (m *Entry) XXX_Size() int

func (*Entry) XXX_Unmarshal

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

type EntryBatch

type EntryBatch struct {
	Entries []Entry `protobuf:"bytes,1,rep,name=entries" json:"entries"`
}

func (*EntryBatch) Descriptor

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

func (*EntryBatch) GetEntries

func (m *EntryBatch) GetEntries() []Entry

func (*EntryBatch) Marshal

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

func (*EntryBatch) MarshalTo

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

func (*EntryBatch) ProtoMessage

func (*EntryBatch) ProtoMessage()

func (*EntryBatch) Reset

func (m *EntryBatch) Reset()

func (*EntryBatch) Size

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

func (*EntryBatch) SizeUpperLimit

func (m *EntryBatch) SizeUpperLimit() (n int)

SizeUpperLimit returns the upper limit size of the entry batch.

func (*EntryBatch) String

func (m *EntryBatch) String() string

func (*EntryBatch) Unmarshal

func (m *EntryBatch) Unmarshal(dAtA []byte) error
func (m *Entry) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowRaft
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Entry: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
			}
			m.Term = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Term |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
			}
			m.Index = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Index |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
			}
			m.Type = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Type |= EntryType(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
			}
			m.Key = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Key |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType)
			}
			m.ClientID = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ClientID |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 6:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SeriesID", wireType)
			}
			m.SeriesID = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SeriesID |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 7:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field RespondedTo", wireType)
			}
			m.RespondedTo = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.RespondedTo |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 8:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Cmd", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRaft
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthRaft
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthRaft
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Cmd = append(m.Cmd[:0], dAtA[iNdEx:postIndex]...)
			if m.Cmd == nil {
				m.Cmd = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipRaft(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthRaft
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthRaft
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}

func (*EntryBatch) XXX_DiscardUnknown

func (m *EntryBatch) XXX_DiscardUnknown()

func (*EntryBatch) XXX_Marshal

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

func (*EntryBatch) XXX_Merge

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

func (*EntryBatch) XXX_Size

func (m *EntryBatch) XXX_Size() int

func (*EntryBatch) XXX_Unmarshal

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

type EntryType

type EntryType int32
const (
	ApplicationEntry  EntryType = 0
	ConfigChangeEntry EntryType = 1
	EncodedEntry      EntryType = 2
	MetadataEntry     EntryType = 3
)

func (EntryType) Enum

func (x EntryType) Enum() *EntryType

func (EntryType) EnumDescriptor

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

func (EntryType) String

func (x EntryType) String() string

func (*EntryType) UnmarshalJSON

func (x *EntryType) UnmarshalJSON(data []byte) error

type IChunkSink

type IChunkSink interface {
	// return (sent, stopped)
	Receive(chunk Chunk) (bool, bool)
	Stop()
	ClusterID() uint64
	ToNodeID() uint64
}

IChunkSink is the snapshot chunk sink for handling snapshot chunks being streamed.

type Membership

type Membership struct {
	ConfigChangeId uint64            `protobuf:"varint,1,opt,name=config_change_id,json=configChangeId" json:"config_change_id"`
	Addresses      map[uint64]string `` /* 139-byte string literal not displayed */
	Removed        map[uint64]bool   `` /* 136-byte string literal not displayed */
	Observers      map[uint64]string `` /* 139-byte string literal not displayed */
	Witnesses      map[uint64]string `` /* 139-byte string literal not displayed */
}

func (*Membership) Descriptor

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

func (*Membership) GetAddresses

func (m *Membership) GetAddresses() map[uint64]string

func (*Membership) GetConfigChangeId

func (m *Membership) GetConfigChangeId() uint64

func (*Membership) GetObservers

func (m *Membership) GetObservers() map[uint64]string

func (*Membership) GetRemoved

func (m *Membership) GetRemoved() map[uint64]bool

func (*Membership) GetWitnesses

func (m *Membership) GetWitnesses() map[uint64]string

func (*Membership) Marshal

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

func (*Membership) MarshalTo

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

func (*Membership) ProtoMessage

func (*Membership) ProtoMessage()

func (*Membership) Reset

func (m *Membership) Reset()

func (*Membership) Size

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

func (*Membership) String

func (m *Membership) String() string

func (*Membership) Unmarshal

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

func (*Membership) XXX_DiscardUnknown

func (m *Membership) XXX_DiscardUnknown()

func (*Membership) XXX_Marshal

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

func (*Membership) XXX_Merge

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

func (*Membership) XXX_Size

func (m *Membership) XXX_Size() int

func (*Membership) XXX_Unmarshal

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

type Message

type Message struct {
	Type      MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"`
	To        uint64      `protobuf:"varint,2,opt,name=to" json:"to"`
	From      uint64      `protobuf:"varint,3,opt,name=from" json:"from"`
	ClusterId uint64      `protobuf:"varint,4,opt,name=cluster_id,json=clusterId" json:"cluster_id"`
	Term      uint64      `protobuf:"varint,5,opt,name=term" json:"term"`
	LogTerm   uint64      `protobuf:"varint,6,opt,name=log_term,json=logTerm" json:"log_term"`
	LogIndex  uint64      `protobuf:"varint,7,opt,name=log_index,json=logIndex" json:"log_index"`
	Commit    uint64      `protobuf:"varint,8,opt,name=commit" json:"commit"`
	Reject    bool        `protobuf:"varint,9,opt,name=reject" json:"reject"`
	Hint      uint64      `protobuf:"varint,10,opt,name=hint" json:"hint"`
	Entries   []Entry     `protobuf:"bytes,11,rep,name=entries" json:"entries"`
	Snapshot  Snapshot    `protobuf:"bytes,12,opt,name=snapshot" json:"snapshot"`
	HintHigh  uint64      `protobuf:"varint,13,opt,name=hint_high,json=hintHigh" json:"hint_high"`
}

func (*Message) CanDrop

func (m *Message) CanDrop() bool

CanDrop returns a boolean value indicating whether the message can be safely dropped.

func (*Message) Descriptor

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

func (*Message) GetClusterId

func (m *Message) GetClusterId() uint64

func (*Message) GetCommit

func (m *Message) GetCommit() uint64

func (*Message) GetEntries

func (m *Message) GetEntries() []Entry

func (*Message) GetFrom

func (m *Message) GetFrom() uint64

func (*Message) GetHint

func (m *Message) GetHint() uint64

func (*Message) GetHintHigh

func (m *Message) GetHintHigh() uint64

func (*Message) GetLogIndex

func (m *Message) GetLogIndex() uint64

func (*Message) GetLogTerm

func (m *Message) GetLogTerm() uint64

func (*Message) GetReject

func (m *Message) GetReject() bool

func (*Message) GetSnapshot

func (m *Message) GetSnapshot() Snapshot

func (*Message) GetTerm

func (m *Message) GetTerm() uint64

func (*Message) GetTo

func (m *Message) GetTo() uint64

func (*Message) GetType

func (m *Message) GetType() MessageType

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) SizeUpperLimit

func (m *Message) SizeUpperLimit() int

SizeUpperLimit returns the upper limit size of the message.

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

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

Unmarshal unmarshals the message instance using the input byte slice.

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

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

func (*Message) XXX_Merge

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

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

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

type MessageBatch

type MessageBatch struct {
	Requests      []Message `protobuf:"bytes,1,rep,name=requests" json:"requests"`
	DeploymentId  uint64    `protobuf:"varint,2,opt,name=deployment_id,json=deploymentId" json:"deployment_id"`
	SourceAddress string    `protobuf:"bytes,3,opt,name=source_address,json=sourceAddress" json:"source_address"`
	BinVer        uint32    `protobuf:"varint,4,opt,name=bin_ver,json=binVer" json:"bin_ver"`
}

func (*MessageBatch) Descriptor

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

func (*MessageBatch) GetBinVer

func (m *MessageBatch) GetBinVer() uint32

func (*MessageBatch) GetDeploymentId

func (m *MessageBatch) GetDeploymentId() uint64

func (*MessageBatch) GetRequests

func (m *MessageBatch) GetRequests() []Message

func (*MessageBatch) GetSourceAddress

func (m *MessageBatch) GetSourceAddress() string

func (*MessageBatch) Marshal

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

func (*MessageBatch) MarshalTo

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

func (*MessageBatch) ProtoMessage

func (*MessageBatch) ProtoMessage()

func (*MessageBatch) Reset

func (m *MessageBatch) Reset()

func (*MessageBatch) Size

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

func (*MessageBatch) SizeUpperLimit

func (m *MessageBatch) SizeUpperLimit() int

SizeUpperLimit returns the upper limit size of the message batch.

func (*MessageBatch) String

func (m *MessageBatch) String() string

func (*MessageBatch) Unmarshal

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

Unmarshal unmarshals the message batch instance using the input byte slice.

func (*MessageBatch) XXX_DiscardUnknown

func (m *MessageBatch) XXX_DiscardUnknown()

func (*MessageBatch) XXX_Marshal

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

func (*MessageBatch) XXX_Merge

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

func (*MessageBatch) XXX_Size

func (m *MessageBatch) XXX_Size() int

func (*MessageBatch) XXX_Unmarshal

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

type MessageType

type MessageType int32
const (
	LocalTick         MessageType = 0
	Election          MessageType = 1
	LeaderHeartbeat   MessageType = 2
	ConfigChangeEvent MessageType = 3
	NoOP              MessageType = 4
	Ping              MessageType = 5
	Pong              MessageType = 6
	Propose           MessageType = 7
	SnapshotStatus    MessageType = 8
	Unreachable       MessageType = 9
	CheckQuorum       MessageType = 10
	BatchedReadIndex  MessageType = 11
	Replicate         MessageType = 12
	ReplicateResp     MessageType = 13
	RequestVote       MessageType = 14
	RequestVoteResp   MessageType = 15
	InstallSnapshot   MessageType = 16
	Heartbeat         MessageType = 17
	HeartbeatResp     MessageType = 18
	ReadIndex         MessageType = 19
	ReadIndexResp     MessageType = 20
	Quiesce           MessageType = 21
	SnapshotReceived  MessageType = 22
	LeaderTransfer    MessageType = 23
	TimeoutNow        MessageType = 24
	RateLimit         MessageType = 25
)

func (MessageType) Enum

func (x MessageType) Enum() *MessageType

func (MessageType) EnumDescriptor

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

func (MessageType) String

func (x MessageType) String() string

func (*MessageType) UnmarshalJSON

func (x *MessageType) UnmarshalJSON(data []byte) error

type RaftDataStatus

type RaftDataStatus struct {
	Address             string `protobuf:"bytes,1,opt,name=address" json:"address"`
	BinVer              uint32 `protobuf:"varint,2,opt,name=bin_ver,json=binVer" json:"bin_ver"`
	HardHash            uint64 `protobuf:"varint,3,opt,name=hard_hash,json=hardHash" json:"hard_hash"`
	LogdbType           string `protobuf:"bytes,4,opt,name=logdb_type,json=logdbType" json:"logdb_type"`
	Hostname            string `protobuf:"bytes,5,opt,name=hostname" json:"hostname"`
	DeploymentId        uint64 `protobuf:"varint,6,opt,name=deployment_id,json=deploymentId" json:"deployment_id"`
	StepWorkerCount     uint64 `protobuf:"varint,7,opt,name=step_worker_count,json=stepWorkerCount" json:"step_worker_count"`
	LogdbShardCount     uint64 `protobuf:"varint,8,opt,name=logdb_shard_count,json=logdbShardCount" json:"logdb_shard_count"`
	MaxSessionCount     uint64 `protobuf:"varint,9,opt,name=max_session_count,json=maxSessionCount" json:"max_session_count"`
	EntryBatchSize      uint64 `protobuf:"varint,10,opt,name=entry_batch_size,json=entryBatchSize" json:"entry_batch_size"`
	AddressByNodeHostId bool   `protobuf:"varint,11,opt,name=address_by_node_host_id,json=addressByNodeHostId" json:"address_by_node_host_id"`
}

func (*RaftDataStatus) Descriptor

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

func (*RaftDataStatus) GetAddress

func (m *RaftDataStatus) GetAddress() string

func (*RaftDataStatus) GetAddressByNodeHostId

func (m *RaftDataStatus) GetAddressByNodeHostId() bool

func (*RaftDataStatus) GetBinVer

func (m *RaftDataStatus) GetBinVer() uint32

func (*RaftDataStatus) GetDeploymentId

func (m *RaftDataStatus) GetDeploymentId() uint64

func (*RaftDataStatus) GetEntryBatchSize

func (m *RaftDataStatus) GetEntryBatchSize() uint64

func (*RaftDataStatus) GetHardHash

func (m *RaftDataStatus) GetHardHash() uint64

func (*RaftDataStatus) GetHostname

func (m *RaftDataStatus) GetHostname() string

func (*RaftDataStatus) GetLogdbShardCount

func (m *RaftDataStatus) GetLogdbShardCount() uint64

func (*RaftDataStatus) GetLogdbType

func (m *RaftDataStatus) GetLogdbType() string

func (*RaftDataStatus) GetMaxSessionCount

func (m *RaftDataStatus) GetMaxSessionCount() uint64

func (*RaftDataStatus) GetStepWorkerCount

func (m *RaftDataStatus) GetStepWorkerCount() uint64

func (*RaftDataStatus) Marshal

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

func (*RaftDataStatus) MarshalTo

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

func (*RaftDataStatus) ProtoMessage

func (*RaftDataStatus) ProtoMessage()

func (*RaftDataStatus) Reset

func (m *RaftDataStatus) Reset()

func (*RaftDataStatus) Size

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

func (*RaftDataStatus) String

func (m *RaftDataStatus) String() string

func (*RaftDataStatus) Unmarshal

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

func (*RaftDataStatus) XXX_DiscardUnknown

func (m *RaftDataStatus) XXX_DiscardUnknown()

func (*RaftDataStatus) XXX_Marshal

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

func (*RaftDataStatus) XXX_Merge

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

func (*RaftDataStatus) XXX_Size

func (m *RaftDataStatus) XXX_Size() int

func (*RaftDataStatus) XXX_Unmarshal

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

type ReadyToRead

type ReadyToRead struct {
	Index     uint64
	SystemCtx SystemCtx
}

ReadyToRead is used to indicate that a previous batch of ReadIndex requests are now ready for read once the entry specified by the Index value is applied in the state machine.

type Response

type Response struct {
}

dummy message used by grpc

func (*Response) Descriptor

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

func (*Response) Marshal

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

func (*Response) MarshalTo

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

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) Size

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

func (*Response) String

func (m *Response) String() string

func (*Response) Unmarshal

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

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

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

func (*Response) XXX_Merge

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

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

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

type Snapshot

type Snapshot struct {
	Filepath    string           `protobuf:"bytes,2,opt,name=filepath" json:"filepath"`
	FileSize    uint64           `protobuf:"varint,3,opt,name=file_size,json=fileSize" json:"file_size"`
	Index       uint64           `protobuf:"varint,4,opt,name=index" json:"index"`
	Term        uint64           `protobuf:"varint,5,opt,name=term" json:"term"`
	Membership  Membership       `protobuf:"bytes,6,opt,name=membership" json:"membership"`
	Files       []*SnapshotFile  `protobuf:"bytes,7,rep,name=files" json:"files,omitempty"`
	Checksum    []byte           `protobuf:"bytes,8,opt,name=checksum" json:"checksum"`
	Dummy       bool             `protobuf:"varint,9,opt,name=dummy" json:"dummy"`
	ClusterId   uint64           `protobuf:"varint,10,opt,name=cluster_id,json=clusterId" json:"cluster_id"`
	Type        StateMachineType `protobuf:"varint,11,opt,name=type,enum=raftpb.StateMachineType" json:"type"`
	Imported    bool             `protobuf:"varint,12,opt,name=imported" json:"imported"`
	OnDiskIndex uint64           `protobuf:"varint,13,opt,name=on_disk_index,json=onDiskIndex" json:"on_disk_index"`
	Witness     bool             `protobuf:"varint,14,opt,name=witness" json:"witness"`
}

field id 1 was used for optional string filename

func (*Snapshot) Descriptor

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

func (*Snapshot) GetChecksum

func (m *Snapshot) GetChecksum() []byte

func (*Snapshot) GetClusterId

func (m *Snapshot) GetClusterId() uint64

func (*Snapshot) GetDummy

func (m *Snapshot) GetDummy() bool

func (*Snapshot) GetFileSize

func (m *Snapshot) GetFileSize() uint64

func (*Snapshot) GetFilepath

func (m *Snapshot) GetFilepath() string

func (*Snapshot) GetFiles

func (m *Snapshot) GetFiles() []*SnapshotFile

func (*Snapshot) GetImported

func (m *Snapshot) GetImported() bool

func (*Snapshot) GetIndex

func (m *Snapshot) GetIndex() uint64

func (*Snapshot) GetMembership

func (m *Snapshot) GetMembership() Membership

func (*Snapshot) GetOnDiskIndex

func (m *Snapshot) GetOnDiskIndex() uint64

func (*Snapshot) GetTerm

func (m *Snapshot) GetTerm() uint64

func (*Snapshot) GetType

func (m *Snapshot) GetType() StateMachineType

func (*Snapshot) GetWitness

func (m *Snapshot) GetWitness() bool

func (*Snapshot) Marshal

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

func (*Snapshot) MarshalTo

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

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) Size

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

func (*Snapshot) String

func (m *Snapshot) String() string

func (*Snapshot) Unmarshal

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

func (*Snapshot) Validate

func (snapshot *Snapshot) Validate(fs vfs.IFS) bool

Validate validates the snapshot instance.

func (*Snapshot) XXX_DiscardUnknown

func (m *Snapshot) XXX_DiscardUnknown()

func (*Snapshot) XXX_Marshal

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

func (*Snapshot) XXX_Merge

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

func (*Snapshot) XXX_Size

func (m *Snapshot) XXX_Size() int

func (*Snapshot) XXX_Unmarshal

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

type SnapshotFile

type SnapshotFile struct {
	Filepath string `protobuf:"bytes,2,opt,name=filepath" json:"filepath"`
	FileSize uint64 `protobuf:"varint,3,opt,name=file_size,json=fileSize" json:"file_size"`
	FileId   uint64 `protobuf:"varint,4,opt,name=file_id,json=fileId" json:"file_id"`
	Metadata []byte `protobuf:"bytes,5,opt,name=metadata" json:"metadata"`
}

field id 1 was used for optional string filename

func (*SnapshotFile) Descriptor

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

func (*SnapshotFile) Filename

func (f *SnapshotFile) Filename() string

Filename returns the filename of the external snapshot file.

func (*SnapshotFile) GetFileId

func (m *SnapshotFile) GetFileId() uint64

func (*SnapshotFile) GetFileSize

func (m *SnapshotFile) GetFileSize() uint64

func (*SnapshotFile) GetFilepath

func (m *SnapshotFile) GetFilepath() string

func (*SnapshotFile) GetMetadata

func (m *SnapshotFile) GetMetadata() []byte

func (*SnapshotFile) Marshal

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

func (*SnapshotFile) MarshalTo

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

func (*SnapshotFile) ProtoMessage

func (*SnapshotFile) ProtoMessage()

func (*SnapshotFile) Reset

func (m *SnapshotFile) Reset()

func (*SnapshotFile) Size

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

func (*SnapshotFile) String

func (m *SnapshotFile) String() string

func (*SnapshotFile) Unmarshal

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

func (*SnapshotFile) XXX_DiscardUnknown

func (m *SnapshotFile) XXX_DiscardUnknown()

func (*SnapshotFile) XXX_Marshal

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

func (*SnapshotFile) XXX_Merge

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

func (*SnapshotFile) XXX_Size

func (m *SnapshotFile) XXX_Size() int

func (*SnapshotFile) XXX_Unmarshal

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

type SnapshotHeader

type SnapshotHeader struct {
	SessionSize     uint64          `protobuf:"varint,1,opt,name=session_size,json=sessionSize" json:"session_size"`
	DataStoreSize   uint64          `protobuf:"varint,2,opt,name=data_store_size,json=dataStoreSize" json:"data_store_size"`
	UnreliableTime  uint64          `protobuf:"varint,3,opt,name=unreliable_time,json=unreliableTime" json:"unreliable_time"`
	GitVersion      string          `protobuf:"bytes,4,opt,name=git_version,json=gitVersion" json:"git_version"`
	HeaderChecksum  []byte          `protobuf:"bytes,5,opt,name=header_checksum,json=headerChecksum" json:"header_checksum"`
	PayloadChecksum []byte          `protobuf:"bytes,6,opt,name=payload_checksum,json=payloadChecksum" json:"payload_checksum"`
	ChecksumType    ChecksumType    `protobuf:"varint,7,opt,name=checksum_type,json=checksumType,enum=raftpb.ChecksumType" json:"checksum_type"`
	Version         uint64          `protobuf:"varint,8,opt,name=version" json:"version"`
	CompressionType CompressionType `protobuf:"varint,9,opt,name=compression_type,json=compressionType,enum=raftpb.CompressionType" json:"compression_type"`
}

func (*SnapshotHeader) Descriptor

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

func (*SnapshotHeader) GetChecksumType

func (m *SnapshotHeader) GetChecksumType() ChecksumType

func (*SnapshotHeader) GetCompressionType

func (m *SnapshotHeader) GetCompressionType() CompressionType

func (*SnapshotHeader) GetDataStoreSize

func (m *SnapshotHeader) GetDataStoreSize() uint64

func (*SnapshotHeader) GetGitVersion

func (m *SnapshotHeader) GetGitVersion() string

func (*SnapshotHeader) GetHeaderChecksum

func (m *SnapshotHeader) GetHeaderChecksum() []byte

func (*SnapshotHeader) GetPayloadChecksum

func (m *SnapshotHeader) GetPayloadChecksum() []byte

func (*SnapshotHeader) GetSessionSize

func (m *SnapshotHeader) GetSessionSize() uint64

func (*SnapshotHeader) GetUnreliableTime

func (m *SnapshotHeader) GetUnreliableTime() uint64

func (*SnapshotHeader) GetVersion

func (m *SnapshotHeader) GetVersion() uint64

func (*SnapshotHeader) Marshal

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

func (*SnapshotHeader) MarshalTo

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

func (*SnapshotHeader) ProtoMessage

func (*SnapshotHeader) ProtoMessage()

func (*SnapshotHeader) Reset

func (m *SnapshotHeader) Reset()

func (*SnapshotHeader) Size

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

func (*SnapshotHeader) String

func (m *SnapshotHeader) String() string

func (*SnapshotHeader) Unmarshal

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

func (*SnapshotHeader) XXX_DiscardUnknown

func (m *SnapshotHeader) XXX_DiscardUnknown()

func (*SnapshotHeader) XXX_Marshal

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

func (*SnapshotHeader) XXX_Merge

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

func (*SnapshotHeader) XXX_Size

func (m *SnapshotHeader) XXX_Size() int

func (*SnapshotHeader) XXX_Unmarshal

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

type State

type State struct {
	Term   uint64 `protobuf:"varint,1,opt,name=term" json:"term"`
	Vote   uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"`
	Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"`
}

func (*State) Descriptor

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

func (*State) GetCommit

func (m *State) GetCommit() uint64

func (*State) GetTerm

func (m *State) GetTerm() uint64

func (*State) GetVote

func (m *State) GetVote() uint64

func (*State) Marshal

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

func (*State) MarshalTo

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

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) Reset

func (m *State) Reset()

func (*State) Size

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

func (*State) String

func (m *State) String() string

func (*State) Unmarshal

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

func (*State) XXX_DiscardUnknown

func (m *State) XXX_DiscardUnknown()

func (*State) XXX_Marshal

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

func (*State) XXX_Merge

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

func (*State) XXX_Size

func (m *State) XXX_Size() int

func (*State) XXX_Unmarshal

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

type StateMachineType

type StateMachineType int32
const (
	UnknownStateMachine    StateMachineType = 0
	RegularStateMachine    StateMachineType = 1
	ConcurrentStateMachine StateMachineType = 2
	OnDiskStateMachine     StateMachineType = 3
)

func (StateMachineType) Enum

func (StateMachineType) EnumDescriptor

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

func (StateMachineType) String

func (x StateMachineType) String() string

func (*StateMachineType) UnmarshalJSON

func (x *StateMachineType) UnmarshalJSON(data []byte) error

type SystemCtx

type SystemCtx struct {
	Low  uint64
	High uint64
}

SystemCtx is used to identify a ReadIndex operation.

type Update

type Update struct {
	ClusterID uint64
	NodeID    uint64
	// The current persistent state of a raft node. It must be stored onto
	// persistent storage before any non-replication can be sent to other nodes.
	// isStateEqual(emptyState) returns true when the state is empty.
	State
	// whether CommittedEntries can be applied without waiting for the Update
	// to be persisted to disk
	FastApply bool
	// EntriesToSave are entries waiting to be stored onto persistent storage.
	EntriesToSave []Entry
	// CommittedEntries are entries already committed in raft and ready to be
	// applied by dragonboat applications.
	CommittedEntries []Entry
	// Whether there are more committed entries ready to be applied.
	MoreCommittedEntries bool
	// Snapshot is the metadata of the snapshot ready to be applied.
	Snapshot Snapshot
	// ReadyToReads provides a list of ReadIndex requests ready for local read.
	ReadyToReads []ReadyToRead
	// Messages is a list of outgoing messages to be sent to remote nodes.
	// As stated above, replication messages can be immediately sent, all other
	// messages must be sent after the persistent state and entries are saved
	// onto persistent storage.
	Messages []Message
	// LastApplied is the actual last applied index reported by the RSM.
	LastApplied uint64
	// UpdateCommit contains info on how the Update instance can be committed
	// to actually progress the state of raft.
	UpdateCommit UpdateCommit
	// DroppedEntries is a list of entries dropped when no leader is available
	DroppedEntries []Entry
	// DroppedReadIndexes is a list of read index requests  dropped when no leader
	// is available.
	DroppedReadIndexes []SystemCtx
}

Update is a collection of state, entries and messages that are expected to be processed by raft's upper layer to progress the raft node modelled as state machine.

func (*Update) HasUpdate

func (ud *Update) HasUpdate() bool

HasUpdate returns a boolean value indicating whether the returned Update instance actually has any update to be processed.

type UpdateCommit

type UpdateCommit struct {
	// the last index known to be pushed to rsm for execution.
	Processed uint64
	// the last index confirmed to be executed.
	LastApplied      uint64
	StableLogTo      uint64
	StableLogTerm    uint64
	StableSnapshotTo uint64
	ReadyToRead      uint64
}

UpdateCommit is used to describe how to commit the Update instance to progress the state of raft.

Jump to

Keyboard shortcuts

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