sodonnel commented on code in PR #10415:
URL: https://github.com/apache/ozone/pull/10415#discussion_r3356847035
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBlockInputStream.java:
##########
@@ -208,8 +214,11 @@ public synchronized void seek(long pos) throws IOException
{
if (pos == position) {
return;
}
- LOG.debug("{}: seek {} -> {}", this, position, pos);
- closeStream();
+ LOG.debug("{}: seek {} -> {}", getName(streamingReader), position, pos);
+ if (streamingReader != null && readBuffer != null) {
+ streamingReader.offerToQueue(readBuffer.getProto());
Review Comment:
I am not sure I understand what is happening here. Say we have pre-read
enabled, 32MB. This means the queue will receive 32 x 1MB chunks from the first
read in the file.
Then the read buffer will pull potentally one of those chunks off the queue
into the buffer, not necessairly all of them - is that correct?
Do we need to ensure the queue is empty before pushing data read from the
queue back onto it?
Then onces we seek, even if we push the read buffer back to the queue, or if
the queue has some data, how do we know where to read from the queue? Eg, we
read 1MB at offset zero. The queue gets 32MB of pre-read data.
Then we seek to offset 100MB - all that queued data needs to be dropped and
a new read from the server.
However if we seek instread to 20MB, then on the queue is some data we need.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]