Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) AddMember(member *Member) error
- func (c *Cluster) Clear()
- func (c *Cluster) ClearMember(id uint64) error
- func (c *Cluster) GetMember(id uint64) *Member
- func (c *Cluster) IsIDRemoved(id uint64) bool
- func (c *Cluster) Members() map[uint64]*Member
- func (c *Cluster) RemoveMember(id uint64) error
- func (c *Cluster) Removed() []uint64
- func (c *Cluster) UpdateMember(id uint64, m *api.RaftMember) error
- func (c *Cluster) ValidateConfigurationChange(cc raftpb.ConfChange) error
- type Member
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrIDExists is thrown when a node wants to join the existing cluster but its ID already exists ErrIDExists = errors.New("membership: can't add node to cluster, node id is a duplicate") // ErrIDRemoved is thrown when a node tries to perform an operation on an existing cluster but was removed ErrIDRemoved = errors.New("membership: node was removed during cluster lifetime") // ErrIDNotFound is thrown when we try an operation on a member that does not exist in the cluster list ErrIDNotFound = errors.New("membership: member not found in cluster list") // ErrConfigChangeInvalid is thrown when a configuration change we received looks invalid in form ErrConfigChangeInvalid = errors.New("membership: ConfChange type should be either AddNode, RemoveNode or UpdateNode") // ErrCannotUnmarshalConfig is thrown when a node cannot unmarshal a configuration change ErrCannotUnmarshalConfig = errors.New("membership: cannot unmarshal configuration change") // ErrMemberRemoved is thrown when a node was removed from the cluster ErrMemberRemoved = errors.New("raft: member was removed from the cluster") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
Cluster represents a set of active raft Members
func NewCluster ¶
func NewCluster() *Cluster
NewCluster creates a new Cluster neighbors list for a raft Member.
func (*Cluster) Clear ¶
func (c *Cluster) Clear()
Clear resets the list of active Members and removed Members.
func (*Cluster) ClearMember ¶
ClearMember removes a node from the Cluster Memberlist, but does NOT add it to the removed list.
func (*Cluster) IsIDRemoved ¶
IsIDRemoved checks if a Member is in the remove set.
func (*Cluster) RemoveMember ¶
RemoveMember removes a node from the Cluster Memberlist, and adds it to the removed list.
func (*Cluster) UpdateMember ¶
func (c *Cluster) UpdateMember(id uint64, m *api.RaftMember) error
UpdateMember updates member address.
func (*Cluster) ValidateConfigurationChange ¶
func (c *Cluster) ValidateConfigurationChange(cc raftpb.ConfChange) error
ValidateConfigurationChange takes a proposed ConfChange and ensures that it is valid.
Click to show internal directories.
Click to hide internal directories.