MCPcopy Create free account
hub / github.com/apache/kvrocks / LookupAndCreateCommand

Method LookupAndCreateCommand

src/server/server.cc:1866–1880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1864}
1865
1866StatusOr<std::unique_ptr<redis::Commander>> Server::LookupAndCreateCommand(const std::string &cmd_name) {
1867 if (cmd_name.empty()) return {Status::RedisUnknownCmd};
1868
1869 auto commands = redis::CommandTable::Get();
1870 auto cmd_iter = commands->find(util::ToLower(cmd_name));
1871 if (cmd_iter == commands->end()) {
1872 return {Status::RedisUnknownCmd};
1873 }
1874
1875 auto cmd_attr = cmd_iter->second;
1876 auto cmd = cmd_attr->factory();
1877 cmd->SetAttributes(cmd_attr);
1878
1879 return std::move(cmd);
1880}
1881
1882Status Server::ScriptExists(const std::string &sha) const {
1883 std::string body;

Callers

nothing calls this directly

Calls 3

ToLowerFunction · 0.85
endMethod · 0.80
SetAttributesMethod · 0.80

Tested by

no test coverage detected