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

Method Set

example/redis_c++/redis_server.cpp:56–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 bool Set(const std::string& db_name, const std::string& key, const std::string& value) {
57 int slot = butil::crc32c::Value(key.c_str(), key.size()) % kHashSlotNum;
58 _mutex[slot].lock();
59 auto& kv = _db_map[db_name];
60 kv[slot][key] = value;
61 _mutex[slot].unlock();
62 return true;
63 }
64
65 bool Auth(const std::string& db_name, const std::string& password) {
66 if (_user_password.find(db_name) == _user_password.end()) {

Callers 2

RunMethod · 0.45
mainFunction · 0.45

Calls 5

ValueFunction · 0.50
c_strMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected