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

Function FunctionFlush

src/storage/scripting.cc:632–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632Status FunctionFlush(redis::Connection *conn, engine::Context *ctx) {
633 auto storage = conn->GetServer()->storage;
634 auto cf = storage->GetCFHandle(ColumnFamilyID::Propagate);
635
636 auto s = storage->DeleteRange(*ctx, rocksdb::WriteOptions(), cf, engine::kLuaLibCodePrefix,
637 util::StringNext(engine::kLuaLibCodePrefix));
638 if (!s.ok()) return {Status::NotOK, s.ToString()};
639
640 s = storage->DeleteRange(*ctx, rocksdb::WriteOptions(), cf, engine::kLuaFuncLibPrefix,
641 util::StringNext(engine::kLuaFuncLibPrefix));
642 if (!s.ok()) return {Status::NotOK, s.ToString()};
643
644 conn->GetServer()->ScriptReset();
645 return Status::OK();
646}
647
648Status EvalGenericCommand(redis::Connection *conn, engine::Context *ctx, const std::string &body_or_sha,
649 const std::vector<std::string> &keys, const std::vector<std::string> &argv, bool evalsha,

Callers 1

ExecuteMethod · 0.85

Calls 7

WriteOptionsClass · 0.85
StringNextFunction · 0.85
GetServerMethod · 0.80
GetCFHandleMethod · 0.80
DeleteRangeMethod · 0.80
ScriptResetMethod · 0.80
ToStringMethod · 0.45

Tested by

no test coverage detected