| 3855 | } |
| 3856 | |
| 3857 | void HandleClientGetTableStatus(const std::vector<std::string> parts, |
| 3858 | ::fedb::client::TabletClient* client) { |
| 3859 | std::vector<::fedb::api::TableStatus> status_vec; |
| 3860 | if (parts.size() == 3) { |
| 3861 | ::fedb::api::TableStatus table_status; |
| 3862 | try { |
| 3863 | if (client->GetTableStatus(boost::lexical_cast<uint32_t>(parts[1]), |
| 3864 | boost::lexical_cast<uint32_t>(parts[2]), |
| 3865 | table_status)) { |
| 3866 | status_vec.push_back(table_status); |
| 3867 | } else { |
| 3868 | std::cout << "gettablestatus failed" << std::endl; |
| 3869 | } |
| 3870 | } catch (boost::bad_lexical_cast& e) { |
| 3871 | std::cout << "Bad gettablestatus format" << std::endl; |
| 3872 | } |
| 3873 | } else if (parts.size() == 1) { |
| 3874 | ::fedb::api::GetTableStatusResponse response; |
| 3875 | if (!client->GetTableStatus(response)) { |
| 3876 | std::cout << "gettablestatus failed" << std::endl; |
| 3877 | return; |
| 3878 | } |
| 3879 | for (int idx = 0; idx < response.all_table_status_size(); idx++) { |
| 3880 | status_vec.push_back(response.all_table_status(idx)); |
| 3881 | } |
| 3882 | } else { |
| 3883 | std::cout << "Bad gettablestatus format" << std::endl; |
| 3884 | return; |
| 3885 | } |
| 3886 | ::fedb::cmd::PrintTableStatus(status_vec); |
| 3887 | } |
| 3888 | |
| 3889 | void HandleClientMakeSnapshot(const std::vector<std::string> parts, |
| 3890 | ::fedb::client::TabletClient* client) { |
no test coverage detected