Documentation
¶
Overview ¶
Package cluster manages the node's membership in the Hive cluster, including peer tracking, consistent hashing, data routing, and rebalancing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("hive: not found")
ErrNotFound is returned when a requested key or field does not exist or has expired.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster owns the cluster state for this node.
func NewCluster ¶
NewCluster creates and starts a cluster Cluster. In clustered mode it binds a TCP server and contacts Seeds to join.
func (*Cluster) Exec ¶
Exec is the exported entry point for store files to run a cluster op. It delegates to dispatch, keeping routing logic internal to this package.
func (*Cluster) KeyCount ¶ added in v1.1.0
KeyCount returns the number of live keys held locally by this node.
type Config ¶
type Config struct {
NodeID string
BindAddr string
BindPort int
Seeds []string
RoutingTimeout time.Duration
ConnPoolSize int
ReplicationFactor int
MemLimit uint64
GossipInterval time.Duration
GossipFanout int
GossipTimeout time.Duration
RebalanceDebounce time.Duration
RebalanceBatchSize int
ReplicationQueueSize int
ReplicationBatchSize int
CleanupInterval time.Duration
Clustered bool
TLSConfig *tls.Config
}
Config holds all configuration for the cluster manager.
type NodeStatus ¶
type NodeStatus uint8
NodeStatus represents a peer's liveness state in the cluster.
const ( NodeAlive NodeStatus = 0 NodeDead NodeStatus = 1 )