Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate the mongo stitcher with the upstream map stitching interface #1763

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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