Skip to content

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

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
Copilot

This comment was marked as outdated.

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

@Copilot 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.

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.

1 participant