Skip to content

Conversation

@jyemin
Copy link
Collaborator

@jyemin jyemin commented Aug 13, 2025

  • Remove EncodingMetadata abstraction and pull the remains into CommandMessage
  • Pull the writeDocuments method into CommandMessage and simplify its parameters

JAVA-5944

* Remove EncodingMetadata abstraction and pull the remains into CommandMessage
* Pull the writeDocuments method into CommandMessage and simplify its parameters

JAVA-5944
@jyemin jyemin requested a review from Copilot August 13, 2025 18:31
@jyemin jyemin self-assigned this Aug 13, 2025

This comment was marked as outdated.

@jyemin jyemin requested a review from Copilot August 13, 2025 18:59
Copy link
Contributor

Copilot AI left a 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.

@jyemin jyemin marked this pull request as ready for review August 18, 2025 15:37
@jyemin jyemin requested a review from a team as a code owner August 18, 2025 15:37
@jyemin jyemin requested review from rozza and removed request for a team August 18, 2025 15:37
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice simplification :)

@jyemin jyemin merged commit 3c3e677 into mongodb:main Aug 20, 2025
52 of 55 checks passed
@jyemin jyemin deleted the JAVA-5944 branch August 20, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants