Documentation ¶
Index ¶
- Constants
- func Marshal(md *Metadata) ([]byte, error)
- type ConsensusTypeMetadataFactory
- type Consenter
- func (*Consenter) Descriptor() ([]byte, []int)
- func (m *Consenter) GetClientTlsCert() []byte
- func (m *Consenter) GetHost() string
- func (m *Consenter) GetPort() uint32
- func (m *Consenter) GetServerTlsCert() []byte
- func (*Consenter) ProtoMessage()
- func (m *Consenter) Reset()
- func (m *Consenter) String() string
- func (m *Consenter) XXX_DiscardUnknown()
- func (m *Consenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Consenter) XXX_Merge(src proto.Message)
- func (m *Consenter) XXX_Size() int
- func (m *Consenter) XXX_Unmarshal(b []byte) error
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)
- func (m *Metadata) GetConsenters() []*Consenter
- func (m *Metadata) GetOptions() *Options
- func (*Metadata) ProtoMessage()
- func (m *Metadata) Reset()
- func (m *Metadata) String() string
- func (m *Metadata) XXX_DiscardUnknown()
- func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Metadata) XXX_Merge(src proto.Message)
- func (m *Metadata) XXX_Size() int
- func (m *Metadata) XXX_Unmarshal(b []byte) error
- type Options
- func (*Options) Descriptor() ([]byte, []int)
- func (m *Options) GetElectionTick() uint32
- func (m *Options) GetHeartbeatTick() uint32
- func (m *Options) GetMaxInflightMsgs() uint32
- func (m *Options) GetMaxSizePerMsg() uint64
- func (m *Options) GetSnapshotInterval() uint64
- func (m *Options) GetTickInterval() uint64
- func (*Options) ProtoMessage()
- func (m *Options) Reset()
- func (m *Options) String() string
- func (m *Options) XXX_DiscardUnknown()
- func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Options) XXX_Merge(src proto.Message)
- func (m *Options) XXX_Size() int
- func (m *Options) XXX_Unmarshal(b []byte) error
- type RaftMetadata
- func (*RaftMetadata) Descriptor() ([]byte, []int)
- func (m *RaftMetadata) GetConfChangeCounts() uint64
- func (m *RaftMetadata) GetConsenters() map[uint64]*Consenter
- func (m *RaftMetadata) GetNextConsenterId() uint64
- func (m *RaftMetadata) GetRaftIndex() uint64
- func (*RaftMetadata) ProtoMessage()
- func (m *RaftMetadata) Reset()
- func (m *RaftMetadata) String() string
- func (m *RaftMetadata) XXX_DiscardUnknown()
- func (m *RaftMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *RaftMetadata) XXX_Merge(src proto.Message)
- func (m *RaftMetadata) XXX_Size() int
- func (m *RaftMetadata) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const TypeKey = "etcdraft"
typekey是一个字符串,用于跨结构标识此一致性实现。
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsensusTypeMetadataFactory ¶
type ConsensusTypeMetadataFactory struct{}
ConsensistypeMetadataFactory允许此实现的协议消息注册 他们的类型和订购者的原型消息。这是原生动物工作所必需的。
func (ConsensusTypeMetadataFactory) NewMessage ¶
func (dogf ConsensusTypeMetadataFactory) NewMessage() proto.Message
newmessage实现order.conensustypemetadatafactory接口。
type Consenter ¶
type Consenter struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` ClientTlsCert []byte `protobuf:"bytes,3,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"` ServerTlsCert []byte `protobuf:"bytes,4,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
同意者表示同意节点(即副本)。
func (*Consenter) Descriptor ¶
func (*Consenter) GetClientTlsCert ¶
func (*Consenter) GetServerTlsCert ¶
func (*Consenter) ProtoMessage ¶
func (*Consenter) ProtoMessage()
func (*Consenter) XXX_DiscardUnknown ¶
func (m *Consenter) XXX_DiscardUnknown()
func (*Consenter) XXX_Marshal ¶
func (*Consenter) XXX_Unmarshal ¶
type Metadata ¶
type Metadata struct { Consenters []*Consenter `protobuf:"bytes,1,rep,name=consenters,proto3" json:"consenters,omitempty"` Options *Options `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
元数据已序列化并设置为ConsensusType的值。中的元数据 当consensistype.type设置为“etcdraft”时的信道配置。
func (*Metadata) Descriptor ¶
func (*Metadata) GetConsenters ¶
func (*Metadata) GetOptions ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) XXX_DiscardUnknown ¶
func (m *Metadata) XXX_DiscardUnknown()
func (*Metadata) XXX_Marshal ¶
func (*Metadata) XXX_Unmarshal ¶
type Options ¶
type Options struct { TickInterval uint64 `protobuf:"varint,1,opt,name=tick_interval,json=tickInterval,proto3" json:"tick_interval,omitempty"` ElectionTick uint32 `protobuf:"varint,2,opt,name=election_tick,json=electionTick,proto3" json:"election_tick,omitempty"` HeartbeatTick uint32 `protobuf:"varint,3,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"` MaxInflightMsgs uint32 `protobuf:"varint,4,opt,name=max_inflight_msgs,json=maxInflightMsgs,proto3" json:"max_inflight_msgs,omitempty"` MaxSizePerMsg uint64 `protobuf:"varint,5,opt,name=max_size_per_msg,json=maxSizePerMsg,proto3" json:"max_size_per_msg,omitempty"` SnapshotInterval uint64 `protobuf:"varint,6,opt,name=snapshot_interval,json=snapshotInterval,proto3" json:"snapshot_interval,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
为所有ETCD/RAFT节点指定选项。这些可以在 每通道基础。
func (*Options) Descriptor ¶
func (*Options) GetElectionTick ¶
func (*Options) GetHeartbeatTick ¶
func (*Options) GetMaxInflightMsgs ¶
func (*Options) GetMaxSizePerMsg ¶
func (*Options) GetSnapshotInterval ¶
func (*Options) GetTickInterval ¶
func (*Options) ProtoMessage ¶
func (*Options) ProtoMessage()
func (*Options) XXX_DiscardUnknown ¶
func (m *Options) XXX_DiscardUnknown()
func (*Options) XXX_Marshal ¶
func (*Options) XXX_Unmarshal ¶
type RaftMetadata ¶
type RaftMetadata struct { //在集群的OSN之间维护映射 //还有他们的救生筏ID。 Consenters map[uint64]*Consenter `` /* 162-byte string literal not displayed */ //携带将分配的筏板ID值 //到将加入该集群的下一个OSN。 NextConsenterId uint64 `protobuf:"varint,2,opt,name=next_consenter_id,json=nextConsenterId,proto3" json:"next_consenter_id,omitempty"` //筏组配置计数 ConfChangeCounts uint64 `protobuf:"varint,3,opt,name=conf_change_counts,json=confChangeCounts,proto3" json:"conf_change_counts,omitempty"` //当前区块ETCD/筏入口索引。 RaftIndex uint64 `protobuf:"varint,4,opt,name=raft_index,json=raftIndex,proto3" json:"raft_index,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
raftmetadata存储raft osn在以下情况下使用的数据: 相互协调,连载成 阻止meta dta字段,并在failres和restart之后使用。
func (*RaftMetadata) Descriptor ¶
func (*RaftMetadata) Descriptor() ([]byte, []int)
func (*RaftMetadata) GetConfChangeCounts ¶
func (m *RaftMetadata) GetConfChangeCounts() uint64
func (*RaftMetadata) GetConsenters ¶
func (m *RaftMetadata) GetConsenters() map[uint64]*Consenter
func (*RaftMetadata) GetNextConsenterId ¶
func (m *RaftMetadata) GetNextConsenterId() uint64
func (*RaftMetadata) GetRaftIndex ¶
func (m *RaftMetadata) GetRaftIndex() uint64
func (*RaftMetadata) ProtoMessage ¶
func (*RaftMetadata) ProtoMessage()
func (*RaftMetadata) Reset ¶
func (m *RaftMetadata) Reset()
func (*RaftMetadata) String ¶
func (m *RaftMetadata) String() string
func (*RaftMetadata) XXX_DiscardUnknown ¶
func (m *RaftMetadata) XXX_DiscardUnknown()
func (*RaftMetadata) XXX_Marshal ¶
func (m *RaftMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RaftMetadata) XXX_Merge ¶
func (dst *RaftMetadata) XXX_Merge(src proto.Message)
func (*RaftMetadata) XXX_Size ¶
func (m *RaftMetadata) XXX_Size() int
func (*RaftMetadata) XXX_Unmarshal ¶
func (m *RaftMetadata) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.