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

Function IsNamespaceLegal

src/server/namespace.cc:37–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 "modify namespace requires the server is running with a configuration file or enabled namespace replication";
36
37Status IsNamespaceLegal(const std::string& ns) {
38 if (ns.size() > UINT8_MAX) {
39 return {Status::NotOK, fmt::format("size exceed limit {}", UINT8_MAX)};
40 }
41 char last_char = ns.back();
42 if (last_char == std::numeric_limits<char>::max()) {
43 return {Status::NotOK, "namespace contain illegal letter"};
44 }
45 return Status::OK();
46}
47
48bool Namespace::IsAllowModify() const {
49 auto config = storage_->GetConfig();

Callers 1

SetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected