Skip to content

idea: RangeReader should send API based on input read buffer's size #3747

@Xuanwo

Description

@Xuanwo

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions