| 520 | } |
| 521 | |
| 522 | std::vector<std::pair<int64, int64>> HashTable::Snapshot() { |
| 523 | mutex_lock lock(update_mu_); |
| 524 | int64 size = size_; |
| 525 | std::vector<std::pair<int64, int64>> ret; |
| 526 | for (int64 i = 0; i < num_tables_; ++i) { |
| 527 | for (auto iter = tables_[i].begin(); iter != tables_[i].end(); ++iter) { |
| 528 | if (iter->second < size) { |
| 529 | ret.emplace_back(iter->first, iter->second); |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | return ret; |
| 534 | } |
| 535 | |
| 536 | void HashTable::Snapshot(std::vector<int64>* keys, |
| 537 | std::vector<int64>* ids) { |
no test coverage detected