aliehsaeedii commented on code in PR #14957:
URL: https://github.com/apache/kafka/pull/14957#discussion_r1420462098


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatter.java:
##########
@@ -266,6 +276,11 @@ private static class PartiallyDeserializedSegmentValue 
implements SegmentValue {
         private int deserIndex = -1; // index up through which this segment 
has been deserialized (inclusive)
         private List<TimestampAndValueSize> 
unpackedReversedTimestampAndValueSizes;
         private List<Integer> cumulativeValueSizes; // ordered same as 
timestamp and value sizes (reverse time-sorted)
+        private int valuesStartingIndex = -1; // the index of first value in 
the segment
+        private int currentCumValueSize = 0; // this is for deserializing a 
segment records in a lazy manner
+        private int currentDeserIndex = 0; // this is for deserializing a 
segment records in a lazy manner

Review Comment:
   > Why do we need to duplicate both variables?
   
   This is what I did in the first place. But it is complicated since other 
methods, such as `doInsert()` and other methods, are manipulating them (I mean 
`deserIndex` and `cumulativeValueSizes`) as well. That's why I decided to have 
my own variables.



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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to