Create size-limiting class for _extraIndexEntries and _missingIndexEntries

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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) 

            Assignee:
            Unassigned
            Reporter:
            Benjamin Pearce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: