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

Method ClearServices

src/brpc/server.cpp:1728–1755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1726}
1727
1728void Server::ClearServices() {
1729 if (status() != READY) {
1730 LOG_IF(ERROR, status() != UNINITIALIZED)
1731 << "Can't clear services from Server[" << version()
1732 << "] which is " << status_str(status());
1733 return;
1734 }
1735 for (ServiceMap::const_iterator it = _fullname_service_map.begin();
1736 it != _fullname_service_map.end(); ++it) {
1737 if (it->second.ownership == SERVER_OWNS_SERVICE) {
1738 delete it->second.service;
1739 }
1740 delete it->second.restful_map;
1741 }
1742 for (MethodMap::const_iterator it = _method_map.begin();
1743 it != _method_map.end(); ++it) {
1744 if (it->second.own_method_status) {
1745 delete it->second.status;
1746 }
1747 delete it->second.http_url;
1748 }
1749 _fullname_service_map.clear();
1750 _service_map.clear();
1751 _method_map.clear();
1752 _builtin_service_count = 0;
1753 _virtual_service_count = 0;
1754 _first_service = NULL;
1755}
1756
1757google::protobuf::Service* Server::FindServiceByFullName(
1758 const butil::StringPiece& full_name) const {

Callers 2

TEST_FFunction · 0.80
StopAndJoinMethod · 0.80

Calls 4

status_strFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
StopAndJoinMethod · 0.64