MCPcopy Create free account
hub / github.com/apache/brpc / FindKeyForNode

Method FindKeyForNode

test/brpc_redis_cluster_unittest.cpp:484–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482 }
483
484 std::string FindKeyForNode(int node_id) const {
485 for (int i = 0; i < 200000; ++i) {
486 std::ostringstream oss;
487 oss << "key_" << node_id << '_' << i;
488 if (OwnerBySlot(HashSlot(oss.str())) == node_id) {
489 return oss.str();
490 }
491 }
492 return "fallback_key";
493 }
494
495 std::vector<std::string> FindKeysForNode(int node_id, size_t count) const {
496 std::vector<std::string> keys;

Callers

nothing calls this directly

Calls 2

OwnerBySlotFunction · 0.85
HashSlotFunction · 0.85

Tested by

no test coverage detected