-
Notifications
You must be signed in to change notification settings - Fork 14k
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
KAFKA-8326: Introduce List Serde #6592
Conversation
Usage: |
Thanks a lot for the PR @yeralin! I like the idea and think it's a good addition. However, adding those classes is a public API change and not a Let me know if you have any question about the KIP process (should actually be well document in the wiki), or if you need any other assistance. Btw: You should also add unit tests :) |
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerde.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
Great to see some progress on this PR, but we still need a KIP... I would recommend to work on the KIP first (or in parallel), @yeralin |
@mjsax KIP, JIRA, and DISCUSS thread are started: https://cwiki.apache.org/confluence/display/KAFKA/KIP-466%3A+Add+support+for+List%3CT%3E+serialization+and+deserialization |
Hmmm, strange I added a test case, but it still says that test results were not found |
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.
Some nits. I also replied to the KIP discuss thread.
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/common/serialization/SerializationTest.java
Show resolved
Hide resolved
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.
Some initial comments.
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/common/serialization/SerializationTest.java
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
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.
Some more comments.
I think we also need tests for the new configuration parameters to make sure they work correctly.
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/common/serialization/SerializationTest.java
Outdated
Show resolved
Hide resolved
Any updates on this? |
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.
Seems you did not push an update yet. Stopped reviewing when I realized it.
The PR also need to be rebased to resolve conflict. Can review again, after it's updated.
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java
Outdated
Show resolved
Hide resolved
@mjsax Sorry, I thought to finish all the discussions first, that's why I did not push. UPD: Merged with apache:trunk |
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.
Stopped reviewing at this point -- there is too much noise in this PR. Avoid to change unrelated files -- it makes reviewing tedious. Please revert all changes to unrelated files (feel free to do a separate cleanup PR if you wish, but don't piggy-back random cleanups)
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/AlterReplicaLogDirsOptions.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
Outdated
Show resolved
Hide resolved
Hey, I'm sorry I thought you wanted me to merge with I think I know how to resolve this. I'll force push before the merge, and then keep pushing my commits only related to UPD: Ok @mjsax it should be much cleaner now :) |
Throw an exception if a user tries to configure already initialized list (de)serializer
70d382b
to
b4e5449
Compare
Ok, updated the KIP with serializing nulls for different strategies. |
b4e5449
to
e7c7789
Compare
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.
Looking good, I think once you just move the upgrade guide docs to the 3.0 section then we can merge.
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. Just give me a ping when the build completes with tests passing (your tests, at least -- there will almost certainly be some unrelated failures, as a handful of tests are super flaky at the moment)
Reword statements Simplify deserialization logic
f3efeb2
to
37569c9
Compare
@ableegoldman Seems like all checks passed :) |
Build has only some unrelated test failures in known flaky |
Merged to trunk! Thanks @yeralin for all the work and patience it took to get this PR in, and to all the reviewers who helped get it here along the way. @yeralin, can you update the KIP to note that it's completed, and then move this KIP to the "Adopted" section on both the KIP main page and the Streams KIPs subpage? 🙏 |
Thanks @yeralin for pushing it through and thanks @ableegoldman for helping out reviewing! Really nice addition! |
…e-allocations-lz4 * apache-github/trunk: (155 commits) KAFKA-12728: Upgrade gradle to 7.0.2 and shadow to 7.0.0 (apache#10606) KAFKA-12778: Fix QuorumController request timeouts and electLeaders (apache#10688) KAFKA-12754: Improve endOffsets for TaskMetadata (apache#10634) Rework on KAFKA-3968: fsync the parent directory of a segment file when the file is created (apache#10680) MINOR: set replication.factor to 1 to make StreamsBrokerCompatibilityService work with old broker (apache#10673) MINOR: prevent cleanup() from being called while Streams is still shutting down (apache#10666) KAFKA-8326: Introduce List Serde (apache#6592) KAFKA-12697: Add Global Topic and Partition count metrics to the Quorum Controller (apache#10679) KAFKA-12648: MINOR - Add TopologyMetadata.Subtopology class for subtopology metadata (apache#10676) MINOR: Update jacoco to 0.8.7 for JDK 16 support (apache#10654) MINOR: exclude all `src/generated` and `src/generated-test` (apache#10671) KAFKA-12772: Move all transaction state transition rules into their states (apache#10667) KAFKA-12758 Added `server-common` module to have server side common classes. (apache#10638) MINOR Removed copying storage libraries specifically as they are already copied. (apache#10647) KAFKA-5876: KIP-216 Part 4, Apply InvalidStateStorePartitionException for Interactive Queries (apache#10657) KAFKA-12747: Fix flakiness in shouldReturnUUIDsWithStringPrefix (apache#10643) MINOR: remove unnecessary placeholder from WorkerSourceTask#recordSent (apache#10659) MINOR: Remove unused `scalatest` definition from `dependencies.gradle` (apache#10655) MINOR: checkstyle version upgrade: 8.20 -> 8.36.2 (apache#10656) KAFKA-12464: minor code cleanup and additional logging in constrained sticky assignment (apache#10645) ...
Hey @yeralin @mjsax @ableegoldman Getting SerializationException in this serde Flag value is derived from bytes size (which is coming >2) which is amount of enum variables hence its breaking please check |
This is while using List where E is class which is Inner |
@venkatesh010 could you please provide a code snippet? |
Introduce List serde for primitive types or custom serdes with a serializer and a deserializer according to https://cwiki.apache.org/confluence/display/KAFKA/KIP-466:+Add+support+for+List%3CT%3E+serialization+and+deserialization
Test cases for the new serde will be added once the PR is reviewed by repo maintainers.