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

Refactor sbe stages debugPrint

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

      Use generalized helper function for SBE stages debugPrint().

      // Help debugPrinter to print an optional slot.
      void addDebugOptionalSlotIdentifier(std::vector<DebugPrinter::Block>& ret,
                                          const boost::optional<value::SlotId>& slot) {
          if (slot) {
              DebugPrinter::addIdentifier(ret, slot.value());
          } else {
              DebugPrinter::addIdentifier(ret, DebugPrinter::kNoneKeyword);
          }
      }
      
      // Help debugPrinter to print a vector of slots.
      void addDebugSlotVector(std::vector<DebugPrinter::Block>& ret, const value::SlotVector& slotVec) {
          ret.emplace_back(DebugPrinter::Block("[`"));
          for (size_t idx = 0; idx < slotVec.size(); ++idx) {
              if (idx) {
                  ret.emplace_back(DebugPrinter::Block("`,"));
              }        DebugPrinter::addIdentifier(ret, slotVec[idx]);
          }
          ret.emplace_back(DebugPrinter::Block("`]"));
      } 

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            zixuan.zhuang@mongodb.com Zixuan Zhuang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: