| 357 | } |
| 358 | |
| 359 | void LocalityAwareLoadBalancer::Feedback(const CallInfo& info) { |
| 360 | butil::DoublyBufferedData<Servers>::ScopedPtr s; |
| 361 | if (_db_servers.Read(&s) != 0) { |
| 362 | return; |
| 363 | } |
| 364 | const size_t* pindex = s->server_map.seek(info.server_id); |
| 365 | if (NULL == pindex) { |
| 366 | return; |
| 367 | } |
| 368 | const size_t index = *pindex; |
| 369 | Weight* w = s->weight_tree[index].weight; |
| 370 | const int64_t diff = w->Update(info, index); |
| 371 | if (diff != 0) { |
| 372 | s->UpdateParentWeights(diff, index); |
| 373 | _total.fetch_add(diff, butil::memory_order_relaxed); |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | int64_t LocalityAwareLoadBalancer::Weight::Update( |
| 378 | const CallInfo& ci, size_t index) { |
nothing calls this directly
no test coverage detected