[SERVER-80260] Refactor sbe stages debugPrint Created: 19/Aug/23  Updated: 30/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Zixuan Zhuang Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

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("`]"));
} 



 Comments   
Comment by Kyle Suarez [ 08/Sep/23 ]

Moving to next quarter's quick wins.

Generated at Thu Feb 08 06:43:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.