MCPcopy Create free account
hub / github.com/F-Stack/f-stack / createClusterNode

Function createClusterNode

app/redis-6.2.6/src/redis-benchmark.c:1057–1077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1055/* Cluster helper functions. */
1056
1057static clusterNode *createClusterNode(char *ip, int port) {
1058 clusterNode *node = zmalloc(sizeof(*node));
1059 if (!node) return NULL;
1060 node->ip = ip;
1061 node->port = port;
1062 node->name = NULL;
1063 node->flags = 0;
1064 node->replicate = NULL;
1065 node->replicas_count = 0;
1066 node->slots = zmalloc(CLUSTER_SLOTS * sizeof(int));
1067 node->slots_count = 0;
1068 node->current_slot_index = 0;
1069 node->updated_slots = NULL;
1070 node->updated_slots_count = 0;
1071 node->migrating = NULL;
1072 node->importing = NULL;
1073 node->migrating_count = 0;
1074 node->importing_count = 0;
1075 node->redis_config = NULL;
1076 return node;
1077}
1078
1079static void freeClusterNode(clusterNode *node) {
1080 int i;

Callers 1

Calls 1

zmallocFunction · 0.85

Tested by

no test coverage detected