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

Method ShowTablet

src/client/ns_client.cc:98–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98bool 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
121bool NsClient::ShowSdkEndpoint(std::vector<TabletInfo>& tablets,
122 std::string& msg) {

Callers 1

HandleNSShowTabletFunction · 0.45

Calls 3

SendRequestMethod · 0.80
msgMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected