| 833 | } |
| 834 | |
| 835 | void HandleNSClientSyncTable(const std::vector<std::string>& parts, |
| 836 | ::fedb::client::NsClient* client) { |
| 837 | if (parts.size() != 3 && parts.size() != 4) { |
| 838 | std::cout << "Bad format for synctable! eg. synctable table_name " |
| 839 | "cluster_alias [pid]" |
| 840 | << std::endl; |
| 841 | return; |
| 842 | } |
| 843 | uint32_t pid = UINT32_MAX; |
| 844 | try { |
| 845 | if (parts.size() == 4) { |
| 846 | pid = boost::lexical_cast<uint32_t>(parts[3]); |
| 847 | } |
| 848 | std::string msg; |
| 849 | bool ret = client->SyncTable(parts[1], parts[2], pid, msg); |
| 850 | if (!ret) { |
| 851 | std::cout << "failed to synctable. error msg: " << msg << std::endl; |
| 852 | return; |
| 853 | } |
| 854 | std::cout << "synctable ok" << std::endl; |
| 855 | } catch (std::exception const& e) { |
| 856 | std::cout << "Invalid args. pid should be uint32_t" << std::endl; |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | void HandleNSClientSetSdkEndpoint(const std::vector<std::string>& parts, |
| 861 | ::fedb::client::NsClient* client) { |
no test coverage detected