Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Change Read's behavior to ensure it reads the exact size of data #4634

Merged
merged 12 commits into from
May 21, 2024

Conversation

Xuanwo
Copy link
Member

@Xuanwo Xuanwo commented May 21, 2024

Read used to be designed to read at most bytes of data.

Our users have reported that it's difficult to use because every call to read requires checking if the returned data meets the limit. Additionally, much of OpenDAL's internal logic relies on reading an exact number of bytes.

So this PR change Read's behavior to ensure it reads the exact size of data. After this change, our users can depend on opendal's behavior instead of performing extra check.

Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@github-actions github-actions bot requested review from morristai and oowl May 21, 2024 10:03
@Xuanwo Xuanwo changed the title refactor(core): Change Read's behavior to ensure it reads the exact size of data. refactor(core): Change Read's behavior to ensure it reads the exact size of data May 21, 2024
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Copy link
Member

@suyanhanx suyanhanx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo requested a review from PsiACE as a code owner May 21, 2024 10:47
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo requested a review from tisonkun as a code owner May 21, 2024 11:12
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo merged commit 7d50e3c into main May 21, 2024
246 of 247 checks passed
@Xuanwo Xuanwo deleted the read_at_with_exact_size branch May 21, 2024 13:21
George-Miao pushed a commit to George-Miao/opendal that referenced this pull request Jun 5, 2024
…ize of data (apache#4634)

* rename limit to size

Signed-off-by: Xuanwo <github@xuanwo.io>

* Add buffer size check

Signed-off-by: Xuanwo <github@xuanwo.io>

* Polish comments

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix comments

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix blocking test

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix binding c

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix bindings

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix cpp

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix java test

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix fuzz test

Signed-off-by: Xuanwo <github@xuanwo.io>

* Format code

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix licenses

Signed-off-by: Xuanwo <github@xuanwo.io>

---------

Signed-off-by: Xuanwo <github@xuanwo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants