WIP: Removing WindowedSerializer interface from public class implementations#21852
Draft
siddharthaDevineni wants to merge 1 commit intoapache:trunkfrom
Draft
WIP: Removing WindowedSerializer interface from public class implementations#21852siddharthaDevineni wants to merge 1 commit intoapache:trunkfrom
siddharthaDevineni wants to merge 1 commit intoapache:trunkfrom
Conversation
…ions. Changes made: - Removed implementations from SessionWindowedSerializer and TimeWindowedSerializer - Updated WindowedStreamPartitioner to use instanceof checks - Updated internal references
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POC: Attempt to clean up
WindowedSerializerleak (https://issues.apache.org/jira/browse/KAFKA-20313)Removing
WindowedSerializerinterface from public API.Changes Made
implements WindowedSerializerfromSessionWindowedSerializerandTimeWindowedSerializerWindowedStreamPartitionerto acceptSerializer<Windowed<K>>instead ofWindowedSerializer<K>serializeBaseKeyfunctionalityProblems Discovered
Architectural Issues:
WindowedStreamPartitioner) now depends on public classes viainstanceofchecksRoot Cause:
WindowedStreamPartitionerneeds to serialize the base key (not the windowed wrapper) for partitioning. This functionality exists in the methodserializeBaseKey(), which is implemented in the publicSessionWindowedSerializerandTimeWindowedSerializerclasses.serializeBaseKey()serves a real architectural need and it cannot be removed without redesigning the partitioning logic inWindowedStreamPartitioner, i mean, how it obtains the serializedKey from windowedKey.Conclusion/Thoughts
Every attempt to hide this method creates either:
So, should we accept
serializeBaseKey()as legitimate public API rather than treating it as leaked internals?If yes, we can properly document it and make it officially public.
@mjsax - Looking for your guidance on the right direction. Please let me know your suggestions.
Thanks.