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

Method Weight

src/brpc/redis_cluster.cpp:1205–1217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1203}
1204
1205int RedisClusterChannel::Weight() {
1206 std::set<std::string> unique;
1207 butil::DoublyBufferedData<std::vector<std::string> >::ScopedPtr s;
1208 if (_db_slot_to_endpoint.Read(&s) != 0) {
1209 return 0;
1210 }
1211 for (size_t i = 0; i < s->size(); ++i) {
1212 if (!(*s)[i].empty()) {
1213 unique.insert((*s)[i]);
1214 }
1215 }
1216 return static_cast<int>(unique.size());
1217}
1218
1219} // namespace brpc

Callers

nothing calls this directly

Calls 4

ReadMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected