MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / clusterLookupNode

Function clusterLookupNode

src/cluster.cpp:1064–1072  ·  view source on GitHub ↗

Node lookup by name */

Source from the content-addressed store, hash-verified

1062
1063/* Node lookup by name */
1064clusterNode *clusterLookupNode(const char *name) {
1065 sds s = sdsnewlen(name, CLUSTER_NAMELEN);
1066 dictEntry *de;
1067
1068 de = dictFind(g_pserver->cluster->nodes,s);
1069 sdsfree(s);
1070 if (de == NULL) return NULL;
1071 return (clusterNode*)dictGetVal(de);
1072}
1073
1074/* This is only used after the handshake. When we connect a given IP/PORT
1075 * as a result of CLUSTER MEET we don't have the node name yet, so we

Callers 6

clusterLoadConfigFunction · 0.85
clusterProcessPacketFunction · 0.85
clusterCommandFunction · 0.85
RM_GetClusterNodeInfoFunction · 0.85

Calls 3

sdsnewlenFunction · 0.85
sdsfreeFunction · 0.85
dictFindFunction · 0.70

Tested by

no test coverage detected