aliehsaeedii commented on PR #14957:
URL: https://github.com/apache/kafka/pull/14957#issuecomment-1848005381

   @mjsax 
   I modified the `find()` method in the best possible way reusing the 
currently defined `deserIndex` and caches. Here is a brief list of changes and 
issues.
   1. I had to define the `reversedDeserIndex` as well as two other caches for 
deserialisation in ascending order of timestamps
   2. I had to add a new parameter `index` to the `find()` method since we are 
iterating over the segment and just relying on `deserIndex` is not safe since 
it may be modified by the other `find()` or be rest with methods such as 
`initializeWithRecord()`
   3. Look at 
[this](https://github.com/aliehsaeedii/kafka/blob/350167e2693db44e5b0357ee8527273c2452eb02/streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatter.java#L387)
 comment please:| I must confess that there is no way to fix this issue.
   
   Conclusion:
   1. I believe that a single instance of `PartiallyDeserializedSegmentValue` 
is not able to call the two `find()` methods (or other class methods) since my 
`find()` is only accessible through the `LogicalSegmentIterator` class. Of 
course, we can call them interleaved in 
`RocksDBVersionedStoreSegmentValueFormatterTest` class. But it is a fake manual 
thing. Please tell me if I am wrong. If this conclusion is correct, defining 
the new `find()` method in `PartiallyDeserializedSegmentValue` class is 
meaningless. Since it anyway is not able to reuse the common deserHelpers. We 
must move it to the `SegmentIterator` class which makes the implementation 
cleaner and easier.
   
   2. If my former conclusion is not correct, then either the new `find()` must 
have its own isolated `deserHelpers` (like my former implementation) or find a 
safe way to reuse the currently available ones (which I do not know yet).
   
   P.S.: This is not a final commit. Committed just for more clarification.


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