Skip to content

Conversation

djibodu
Copy link
Contributor

@djibodu djibodu commented May 29, 2025

What

In order to allow for overriding of some key functionality of the MetadataEncoderService on CCloud, an interface has been created for the class, with the default implementation remaining as is.

Checklist

Please answer the questions with Y, N or N/A if not applicable.

  • [ ] Contains customer facing changes? Including API/behavior changes
  • [ ] Is this change gated behind config(s)?
    • List the config(s) needed to be set to enable this change
  • [ ] Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required
  • [ ] Does this change require modifying existing system tests or adding new system tests?
    • If so, include tracking information for the system test changes

References

JIRA:

Test & Review

Open questions / Follow-ups

@Copilot Copilot AI review requested due to automatic review settings May 29, 2025 18:27
@djibodu djibodu requested a review from a team as a code owner May 29, 2025 18:27
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@djibodu djibodu changed the base branch from master to 7.7.x May 29, 2025 18:27
Copy link

@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 adds an interface for the MetadataEncoderService to allow key functionality to be overridden, ensuring improved flexibility on CCloud. Key changes include:

  • Creation of MetadataEncoderServiceInterface with essential metadata encoding methods.
  • Updated MetadataEncoderService implementing the new interface with changes to support a rotationNeeded flag.
  • Modification of KafkaSchemaRegistry to utilize the new interface and instantiate MetadataEncoderService via a factory method.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
core/src/main/java/io/confluent/kafka/schemaregistry/storage/encoder/MetadataEncoderServiceInterface.java New interface defining metadata encoding and transformation methods.
core/src/main/java/io/confluent/kafka/schemaregistry/storage/encoder/MetadataEncoderService.java Updated service implementation to include new interface and rotationNeeded logic.
core/src/main/java/io/confluent/kafka/schemaregistry/storage/KafkaSchemaRegistry.java Refactored to use the new interface and updated instantiation of the encoder service.

@@ -350,7 +355,7 @@ public Serializer<SchemaRegistryKey, SchemaRegistryValue> getSerializer() {
}

public MetadataEncoderService getMetadataEncoder() {
return metadataEncoder;
return (MetadataEncoderService) metadataEncoder;
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider returning the service as a MetadataEncoderServiceInterface rather than casting to the concrete type to preserve abstraction.

Copilot uses AI. Check for mistakes.

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiFunction;

public interface MetadataEncoderServiceInterface {
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding JavaDoc comments to the interface methods to better document expected behaviors and usage for implementers.

Copilot uses AI. Check for mistakes.

@rayokota
Copy link
Member

What's the purpose of this PR? It seems you're also changing the behavior by enabling rotation

@djibodu djibodu changed the title DGS-20677: RM Metadata Encoder Integration DGS-20677: RM Metadata Encoder Integration [do not merge] Jun 11, 2025
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