MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / ch_ring_get_server_from_uint64

Function ch_ring_get_server_from_uint64

example/cacheCluster/consistentHash.c:139–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139int ch_ring_get_server_from_uint64(uint64_t obj_id,
140 const ring_t *const ring) {
141 char key[8];
142 memcpy(key, (char *) &obj_id, 8);
143 key[7] = 0;
144 return (ring->vnodes + ch_ring_get_vnode_idx(key, ring))->server_id;
145}
146
147/* n: the number of servers that's going to retrieve */
148void ch_ring_get_servers(const char *const key, const ring_t *const ring,

Callers 1

getMethod · 0.85

Calls 1

ch_ring_get_vnode_idxFunction · 0.85

Tested by

no test coverage detected