| 605 | typedef butil::FlatMap<uint64_t, uint64_t> PositionHintMap; |
| 606 | |
| 607 | static void fill_position_hint_map(PositionHintMap* map, |
| 608 | std::vector<uint64_t>* keys) { |
| 609 | srand(time(NULL)); |
| 610 | const size_t N = 5; |
| 611 | if (!map->initialized()) { |
| 612 | ASSERT_EQ(0, map->init(N * 3 / 2, 80)); |
| 613 | } |
| 614 | |
| 615 | keys->reserve(N); |
| 616 | keys->clear(); |
| 617 | map->clear(); |
| 618 | for (size_t i = 0; i < N; ++i) { |
| 619 | uint64_t key = rand(); |
| 620 | if (map->seek(key)) { |
| 621 | continue; |
| 622 | } |
| 623 | keys->push_back(key); |
| 624 | (*map)[key] = i; |
| 625 | } |
| 626 | LOG(INFO) << map->bucket_info() << ", size=" << map->size(); |
| 627 | } |
| 628 | |
| 629 | struct CountOnPause { |
| 630 | CountOnPause() : num_paused(0) {} |
no test coverage detected