yeralin commented on a change in pull request #6592:
URL: https://github.com/apache/kafka/pull/6592#discussion_r615075349



##########
File path: 
clients/src/main/java/org/apache/kafka/common/serialization/Serdes.java
##########
@@ -128,13 +128,27 @@ public UUIDSerde() {
 
     static public final class ListSerde<Inner> extends 
WrapperSerde<List<Inner>> {
 
+        final static int NEGATIVE_SIZE_VALUE = -1;

Review comment:
       Basically, if we are following `VARIABLE_SIZE` serialization strategy 
**and** we have a `null` entry in our list, we encode this null entry as `-1`, 
so that during deserialization when we encounter `-1`, we append `null` entry 
to our list.
   
   Example, to serialize a list like `{"A", "B", null, "C"}` of strings, the 
payload would look smth like:
   ```
   serialization_flag | size_of_list_4 | A_size | A_encoded | B_size | 
B_encoded | -1 | C_size | C_encoded
   ```
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to