jiang13021 commented on PR #3534:
URL: https://github.com/apache/celeborn/pull/3534#issuecomment-3519700704

   > Nice catch, I want to know if return -1 then what will happen?
   
   In 
org.apache.celeborn.client.read.CelebornInputStream.CelebornInputStreamImpl#read(),
 we call the fillBuffer() function to move to the next chunk and decompress the 
data. The decompressed data is then written into the byte[] rawDataBuf, and we 
update limit and position accordingly; limit is set to the length of the 
decompressed data, and position is set to 0. 
   
   If decompressor.decompress(compressedBuf, rawDataBuf, 0) returns -1, we set 
position to 0 and limit to -1. As a result, when we subsequently check if 
position >= limit, it triggers another read() -> fillBuffer() -> 
moveToNextChunk(), and skipping the current chunk.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to