Skip to content

Commit

Permalink
Integrate mongo stitcher with the upstream map stitching interface
Browse files Browse the repository at this point in the history
Signed-off-by: Kartik Pattaswamy <[email protected]>
  • Loading branch information
kpattaswamy committed Nov 6, 2023
1 parent 62b8080 commit 2ed5e7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ size_t FindFrameBoundary<mongodb::Frame>(message_type_t, std::string_view, size_
return std::string::npos;
}

template <>
mongodb::stream_id_t GetStreamID(mongodb::Frame* frame) {
if (frame->response_to == 0) {
return frame->request_id;
}

return frame->response_to;
}

} // namespace protocols
} // namespace stirling
} // namespace px
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ template <>
size_t FindFrameBoundary<mongodb::Frame>(message_type_t type, std::string_view buf,
size_t start_pos, NoState*);

template <>
mongodb::stream_id_t GetStreamID(mongodb::Frame* frame);

} // namespace protocols
} // namespace stirling
} // namespace px
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ struct ProtocolTraits : public BaseProtocolTraits<Record> {
using record_type = Record;
using state_type = StateWrapper;
using key_type = stream_id_t;
static constexpr StreamSupport stream_support = BaseProtocolTraits<Record>::UseStream;
};

} // namespace mongodb
Expand Down

0 comments on commit 2ed5e7a

Please sign in to comment.