| 4803 | } |
| 4804 | |
| 4805 | void HandleClientDelete(const std::vector<std::string>& parts, |
| 4806 | ::fedb::client::TabletClient* client) { |
| 4807 | if (parts.size() < 4) { |
| 4808 | std::cout << "Bad delete format" << std::endl; |
| 4809 | return; |
| 4810 | } |
| 4811 | try { |
| 4812 | uint32_t tid = boost::lexical_cast<uint32_t>(parts[1]); |
| 4813 | uint32_t pid = boost::lexical_cast<uint32_t>(parts[2]); |
| 4814 | std::string msg; |
| 4815 | std::string idx_name; |
| 4816 | if (parts.size() > 4) { |
| 4817 | idx_name = parts[4]; |
| 4818 | } |
| 4819 | if (client->Delete(tid, pid, parts[3], idx_name, msg)) { |
| 4820 | std::cout << "Delete ok" << std::endl; |
| 4821 | } else { |
| 4822 | std::cout << "Delete failed" << std::endl; |
| 4823 | } |
| 4824 | } catch (std::exception const& e) { |
| 4825 | std::cout << "Invalid args, tid pid should be uint32_t" << std::endl; |
| 4826 | } |
| 4827 | } |
| 4828 | |
| 4829 | void HandleClientBenScan(const std::vector<std::string>& parts, |
| 4830 | ::fedb::client::TabletClient* client) { |
no test coverage detected