RangeReader will send request to read the entire range everytime no matter how large the read buffer size is. So opendal doesn't work well in this case:
let r = op.reader(path).await?;
r.read(&mut [u8;1]).await?;
r.seek(SeekFrom::Current(1)).await?;
r.read(&mut [u8;1]).await?;
r.seek(SeekFrom::Current(1)).await?;
For every read call, range reader will send a new request to read the entire range but only consume a small piece:
- The connection will have to abort, makes it can't be reuse.
- And more data will be fecthed from server side.
Maybe we can send request based on user's input buffer size instead. For users we want to do small read, they can add a buffer over the reader instead.
RangeReaderwill send request to read the entire range everytime no matter how large the read buffer size is. So opendal doesn't work well in this case:For every read call, range reader will send a new request to read the entire range but only consume a small piece:
Maybe we can send request based on user's input buffer size instead. For users we want to do small read, they can add a
bufferover the reader instead.