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

Method ScriptGet

src/server/server.cc:1887–1896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1885}
1886
1887Status Server::ScriptGet(const std::string &sha, std::string *body) const {
1888 std::string func_name = engine::kLuaFuncSHAPrefix + sha;
1889 auto cf = storage->GetCFHandle(ColumnFamilyID::Propagate);
1890 engine::Context ctx(storage);
1891 auto s = storage->Get(ctx, ctx.GetReadOptions(), cf, func_name, body);
1892 if (!s.ok()) {
1893 return {s.IsNotFound() ? Status::NotFound : Status::NotOK, s.ToString()};
1894 }
1895 return Status::OK();
1896}
1897
1898Status Server::ScriptSet(const std::string &sha, const std::string &body) const {
1899 std::string func_name = engine::kLuaFuncSHAPrefix + sha;

Callers 1

EvalGenericCommandFunction · 0.80

Calls 4

GetCFHandleMethod · 0.80
GetReadOptionsMethod · 0.80
GetMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected