Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-87752

Refactor `PrepareExecutionHelper` from `get_executor.cpp`

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution

      Currently the `PrepareExecutionHelper` abstract class uses a `std::unique_ptr<ResultType>` to return the planning results. Considering the recent changes, it is now overly complex and forces sub-classes to employ this awkward pattern for every method:

      auto result = releaseResult();
      // init result.
      return result; 

      We should strive to simplify this class as much as possible. Here's a non-exhaustive list of ideas:

      • Get rid of std::unique_ptr, as there's no need for any indirection here.
      • Consider constructing building the result directly in the targeted method. 
      • Consider renaming this class to something more descriptive (ex: AbstractPlannerFactory?)
      • Consider extracting `PrepareExecutionHelper...` classes to a separate file

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            catalin.sumanaru@mongodb.com Catalin Sumanaru
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: