Documentation ¶
Overview ¶
Package cluster represents the nodes within a Veracity cluster.
Index ¶
Constants ¶
View Source
const ( // DefaultRenewInterval is the default interval at which a [Registrar] // renews a node's registration. // // The registration period is always set to 2 * DefaultRenewInterval. DefaultRenewInterval = 10 * time.Second // DefaultRegistryPollInterval is the default interval at which the registry // polls the underlying key-value store for changes. DefaultRegistryPollInterval = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MembershipChanged ¶
type MembershipChanged struct {
Registered, Deregistered []Node
}
MembershipChanged is an engine event that indicates a change in membership to the cluster.
type Node ¶
type Node struct { // ID is a unique identifier for the node. // // It may be generated when the node starts up, or it may be static on a // given machine or container. ID *uuidpb.UUID // Addresses is a list of network addresses for the node's gRPC server, in // order of preference. Addresses []string }
A Node is a member of the cluster.
type Partitioner ¶
type Partitioner struct {
// contains filtered or unexported fields
}
Partitioner determines which node is responsible for handling a specific workload.
func (*Partitioner) AddNode ¶
func (p *Partitioner) AddNode(id *uuidpb.UUID)
AddNode adds a node to the partitioner.
func (*Partitioner) RemoveNode ¶
func (p *Partitioner) RemoveNode(id *uuidpb.UUID)
RemoveNode removes a node from the partitioner.
type Registrar ¶
type Registrar struct { Keyspaces kv.BinaryStore Node Node RenewInterval time.Duration Shutdown signaling.Latch Logger *slog.Logger // contains filtered or unexported fields }
Registrar registers and periodically renews a node's registration with the registry.
type RegistryObserver ¶
type RegistryObserver struct { Keyspaces kv.BinaryStore MembershipChanged chan<- MembershipChanged Shutdown signaling.Latch PollInterval time.Duration // contains filtered or unexported fields }
RegistryObserver emits events about changes to the nodes in the registry.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.