| 96 | } |
| 97 | |
| 98 | bool NsClient::ShowTablet(std::vector<TabletInfo>& tablets, std::string& msg) { |
| 99 | ::fedb::nameserver::ShowTabletRequest request; |
| 100 | ::fedb::nameserver::ShowTabletResponse response; |
| 101 | bool ok = |
| 102 | client_.SendRequest(&::fedb::nameserver::NameServer_Stub::ShowTablet, |
| 103 | &request, &response, FLAGS_request_timeout_ms, 1); |
| 104 | msg = response.msg(); |
| 105 | if (ok && response.code() == 0) { |
| 106 | for (int32_t i = 0; i < response.tablets_size(); i++) { |
| 107 | const ::fedb::nameserver::TabletStatus& status = |
| 108 | response.tablets(i); |
| 109 | TabletInfo info; |
| 110 | info.endpoint = status.endpoint(); |
| 111 | info.state = status.state(); |
| 112 | info.age = status.age(); |
| 113 | info.real_endpoint = status.real_endpoint(); |
| 114 | tablets.push_back(info); |
| 115 | } |
| 116 | return true; |
| 117 | } |
| 118 | return false; |
| 119 | } |
| 120 | |
| 121 | bool NsClient::ShowSdkEndpoint(std::vector<TabletInfo>& tablets, |
| 122 | std::string& msg) { |
no test coverage detected