MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / HandleClientSetLimit

Function HandleClientSetLimit

src/cmd/fedb.cc:4006–4040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4004}
4005
4006void HandleClientSetLimit(const std::vector<std::string> parts,
4007 ::fedb::client::TabletClient* client) {
4008 if (parts.size() < 3) {
4009 std::cout << "Bad set limit format" << std::endl;
4010 return;
4011 }
4012 try {
4013 std::string key = parts[1];
4014 if (std::isupper(key[0])) {
4015 std::string subname = key.substr(1);
4016 for (char e : subname) {
4017 if (std::isupper(e)) {
4018 std::cout << "Invalid args name which should be Put , Scan "
4019 ", Get or Server"
4020 << std::endl;
4021 return;
4022 }
4023 }
4024 } else {
4025 std::cout << "Invalid args name which should be Put , Scan , Get "
4026 "or Server"
4027 << std::endl;
4028 return;
4029 }
4030 int32_t limit = boost::lexical_cast<int32_t>(parts[2]);
4031 bool ok = client->SetMaxConcurrency(key, limit);
4032 if (ok) {
4033 std::cout << "Set Limit ok" << std::endl;
4034 } else {
4035 std::cout << "Fail to set limit" << std::endl;
4036 }
4037 } catch (boost::bad_lexical_cast& e) {
4038 std::cout << "Bad set limit format" << std::endl;
4039 }
4040}
4041
4042void HandleClientChangeRole(const std::vector<std::string> parts,
4043 ::fedb::client::TabletClient* client) {

Callers 1

StartClientFunction · 0.85

Calls 2

SetMaxConcurrencyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected