MCPcopy Create free account
hub / github.com/apache/brpc / find

Method find

tools/trackme_server/trackme_server.cpp:247–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247bool BugsLoader::find(int64_t revision, brpc::TrackMeResponse* response) {
248 // Add reference to make sure the bug list is not deleted.
249 std::shared_ptr<BugList> local_list = _bug_list;
250 if (local_list.get() == NULL) {
251 return false;
252 }
253 // Reading the list in this function is always safe because a BugList
254 // is never changed after creation.
255 bool found = false;
256 for (size_t i = 0; i < local_list->size(); ++i) {
257 const RevisionInfo & info = (*local_list)[i];
258 if (info.min_rev <= revision && revision <= info.max_rev) {
259 found = true;
260 if (info.severity > response->severity()) {
261 response->set_severity(info.severity);
262 }
263 if (info.severity != brpc::TrackMeOK) {
264 std::string* error = response->mutable_error_text();
265 char prefix[64];
266 if (info.min_rev != info.max_rev) {
267 snprintf(prefix, sizeof(prefix), "[r%lld-r%lld] ",
268 (long long)info.min_rev, (long long)info.max_rev);
269 } else {
270 snprintf(prefix, sizeof(prefix), "[r%lld] ",
271 (long long)info.min_rev);
272 }
273 error->append(prefix);
274 error->append(info.error_text);
275 error->append("; ");
276 }
277 }
278 }
279 return found;
280}

Callers 15

mainFunction · 0.45
AuthMethod · 0.45
GetMethod · 0.45
mainFunction · 0.45
TrackMeMethod · 0.45
TESTFunction · 0.45
DoGetMethod · 0.45
DoGetMethod · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45

Calls 5

snprintfFunction · 0.85
severityMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45

Tested by 15

TESTFunction · 0.36
DoGetMethod · 0.36
DoGetMethod · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TestFindSymbol1Function · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
ReducerTest_windowFunction · 0.36
TEST_FFunction · 0.36