Handles FerricStore cluster inspection and management commands.
Provides per-shard health and statistics information by querying the ETS tables owned by each shard GenServer, plus cluster membership operations.
Supported commands
Inspection
CLUSTER.HEALTH-- returns per-shard status including role, health, key count, and memory usageCLUSTER.STATS-- returns per-shard key/memory stats plus totalsCLUSTER.KEYSLOT <key>-- returns the hash slot for a keyCLUSTER.SLOTS-- returns slot range assignmentsCLUSTER.STATUS-- returns detailed cluster info: nodes, per-shard leader/follower info, rolesCLUSTER.ROLE-- returns this node's configured cluster role
Membership management
CLUSTER.JOIN <node>-- adds a node to the clusterCLUSTER.LEAVE-- gracefully removes this node from the clusterCLUSTER.FAILOVER <shard_index> <target_node>-- transfers shard leadership to a specific nodeCLUSTER.PROMOTE <node>-- promotes a replica to voter for all shardsCLUSTER.DEMOTE <node>-- demotes a voter to replica for all shards
Summary
Functions
Handles a cluster command.