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

Function clusterSendUpdate

src/cluster.cpp:2821–2831  ·  view source on GitHub ↗

Send an UPDATE message to the specified link carrying the specified 'node' * slots configuration. The node name, slots bitmap, and configEpoch info * are included. */

Source from the content-addressed store, hash-verified

2819 * slots configuration. The node name, slots bitmap, and configEpoch info
2820 * are included. */
2821void clusterSendUpdate(clusterLink *link, clusterNode *node) {
2822 clusterMsg buf[1];
2823 clusterMsg *hdr = (clusterMsg*) buf;
2824
2825 if (link == NULL) return;
2826 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_UPDATE);
2827 memcpy(hdr->data.update.nodecfg.nodename,node->name,CLUSTER_NAMELEN);
2828 hdr->data.update.nodecfg.configEpoch = htonu64(node->configEpoch);
2829 memcpy(hdr->data.update.nodecfg.slots,node->slots,sizeof(node->slots));
2830 clusterSendMessage(link,(unsigned char*)buf,ntohl(hdr->totlen));
2831}
2832
2833/* Send a MODULE message.
2834 *

Callers 1

clusterProcessPacketFunction · 0.85

Calls 2

clusterBuildMessageHdrFunction · 0.85
clusterSendMessageFunction · 0.85

Tested by

no test coverage detected