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

Use opendal::Buffer to replace Chunk bytes in fuse merge read io #16991

Open
sundy-li opened this issue Dec 3, 2024 · 1 comment
Open

Use opendal::Buffer to replace Chunk bytes in fuse merge read io #16991

sundy-li opened this issue Dec 3, 2024 · 1 comment
Assignees

Comments

@sundy-li
Copy link
Member

sundy-li commented Dec 3, 2024

Summary

read_range will call to_vec for opendal::Buffer which allocates new memory for each range.

We can use opendal::Buffer inside MergeIOReadResult instead of Bytes

 #[inline]
    #[async_backtrace::framed]
    async fn read_range(
        op: Operator,
        path: &str,
        index: usize,
        start: u64,
        end: u64,
    ) -> Result<(usize, Vec<u8>)> {
        let chunk = op.read_with(path).range(start..end).await?;
        Ok((index, chunk.to_vec()))
    }
@Xuanwo
Copy link
Member

Xuanwo commented Dec 3, 2024

Will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants