| 35 | "modify namespace requires the server is running with a configuration file or enabled namespace replication"; |
| 36 | |
| 37 | Status 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 | |
| 48 | bool Namespace::IsAllowModify() const { |
| 49 | auto config = storage_->GetConfig(); |