| 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()) { |