Returns true if any of the node ids in node_ids are selected for eviction.
| 571 | |
| 572 | // Returns true if any of the node ids in node_ids are selected for eviction. |
| 573 | bool IsEvicted(std::vector<NodeEvictionCandidate> candidates, const std::unordered_set<NodeId>& node_ids, FastRandomContext& random_context) |
| 574 | { |
| 575 | Shuffle(candidates.begin(), candidates.end(), random_context); |
| 576 | const std::optional<NodeId> evicted_node_id = SelectNodeToEvict(std::move(candidates)); |
| 577 | if (!evicted_node_id) { |
| 578 | return false; |
| 579 | } |
| 580 | return node_ids.count(*evicted_node_id); |
| 581 | } |
| 582 | |
| 583 | // Create number_of_nodes random nodes, apply setup function candidate_setup_fn, |
| 584 | // apply eviction logic and then return true if any of the node ids in node_ids |
no test coverage detected