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

Method FindKeysForNode

test/brpc_redis_cluster_unittest.cpp:495–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493 }
494
495 std::vector<std::string> FindKeysForNode(int node_id, size_t count) const {
496 std::vector<std::string> keys;
497 keys.reserve(count);
498 for (int i = 0; i < 400000 && keys.size() < count; ++i) {
499 std::ostringstream oss;
500 oss << "key_batch_" << node_id << '_' << i;
501 if (OwnerBySlot(HashSlot(oss.str())) == node_id) {
502 keys.push_back(oss.str());
503 }
504 }
505 return keys;
506 }
507
508 std::string FindHashTagForNode(int node_id) const {
509 for (int i = 0; i < 200000; ++i) {

Callers

nothing calls this directly

Calls 5

OwnerBySlotFunction · 0.85
HashSlotFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected