TODO(chihan.hs): extract all children in one traverse
| 602 | |
| 603 | // TODO(chihan.hs): extract all children in one traverse |
| 604 | Status CoalescedHashTable::ChildSnapshot( |
| 605 | const string& name, std::vector<std::pair<int64, int64>>* output) { |
| 606 | mutex_lock lock(update_mu_); |
| 607 | int64 size = size_; |
| 608 | string child_name = ChildName(name); |
| 609 | int64 index = index_map_[child_name]; |
| 610 | for (int64 i = 0; i < num_tables_; ++i) { |
| 611 | for (auto iter = tables_[i].begin(); iter != tables_[i].end(); ++iter) { |
| 612 | if (iter->second < size && Match(iter->first, index)) { |
| 613 | output->emplace_back(Decode(iter->first), iter->second); |
| 614 | } |
| 615 | } |
| 616 | } |
| 617 | return Status::OK(); |
| 618 | } |
| 619 | |
| 620 | std::function<void(int64*,size_t)> CoalescedHashTable::MakeReviserFn( |
| 621 | const string& name) { |
no test coverage detected