These two class members are currently stored as `std::vector<BSONObj>`, however the code is expected to maintain an invariant that the total size of the objects in the container are capped to a memory limit.
This is implemented by some free functions that accept the input values, a memory limit, and operate the vector as a heap to evict the largest objects first. Effectively prioritizing quantity of entries over maximum size.
This should be refactored to an explicit class that properly maintains the these invariants through the public interface:
- Largest entries evicted upon exceeding the size limit
- Minimum 1 entry maintained even if it exceeds the size limit
- Getter for current size
- Underlying container is accessible for const iteration (this is not provided by default with the C++ STL priority_queue implementation)
- is related to
-
SERVER-127596 Parallelize record store traversal
-
- In Progress
-