-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Simplify RequestMessage class hierarchy #1787
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
Conversation
* Remove EncodingMetadata abstraction and pull the remains into CommandMessage * Pull the writeDocuments method into CommandMessage and simplify its parameters JAVA-5944
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the RequestMessage class hierarchy by removing the EncodingMetadata abstraction layer and consolidating its functionality directly into CommandMessage. The changes eliminate unnecessary indirection and streamline the encoding process for MongoDB Wire Protocol messages.
Key Changes:
- Remove the EncodingMetadata class and its associated methods from RequestMessage
- Simplify the encoding method signature by removing metadata return value
- Move document writing logic directly into CommandMessage with a more specific implementation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| RequestMessage.java | Removes EncodingMetadata class and simplifies encoding method signature |
| CompressedMessage.java | Updates encoding method to match new signature without metadata return |
| CommandMessage.java | Adds direct tracking of first document position and includes document writing logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java
Show resolved
Hide resolved
…ssage.java Co-authored-by: Copilot <[email protected]>
rozza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice simplification :)
JAVA-5944