Commit c6157b35 authored by Josh Hershberg's avatar Josh Hershberg
Browse files

Cluster refactor: Make clustering functions common



Move primary functions used to implement datapath
clustering into cluster.c, making them shared. This
required adding "accessor" and other functions to
abstract access to node details and cluster state.
Signed-off-by: default avatarJosh Hershberg <yehoshua@redis.com>
parent 4afc54ad
This diff is collapsed.
...@@ -87,6 +87,15 @@ void clusterCommandShards(client *c); ...@@ -87,6 +87,15 @@ void clusterCommandShards(client *c);
sds clusterGenNodeDescription(client *c, clusterNode *node, int tls_primary); sds clusterGenNodeDescription(client *c, clusterNode *node, int tls_primary);
int getNumSlaves(clusterNode *node); int getNumSlaves(clusterNode *node);
clusterNode *getSlave(clusterNode *node, int slave_idx); clusterNode *getSlave(clusterNode *node, int slave_idx);
clusterNode *getMigratingSlotDest(int slot);
clusterNode *getImportingSlotSource(int slot);
int isClusterHealthy(void);
clusterNode *getNodeBySlot(int slot);
int getNodeClientPort(clusterNode *n, int use_tls);
char* clusterNodeHostname(clusterNode *node);
const char *getPreferredEndpoint(clusterNode *n);
void migrateCommand(client *c);
long long getReplOffset(clusterNode *node);
char **clusterDebugCommandHelp(void); char **clusterDebugCommandHelp(void);
ConnectionType *connTypeOfCluster(void); ConnectionType *connTypeOfCluster(void);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment