Skip to content

User-configurable coalesce range #574

@kylebarron

Description

@kylebarron

Right now, when we call get_ranges from Python it calls the underlying get_ranges method from the trait:

let out = runtime.block_on(store.as_ref().get_ranges(path.as_ref(), &ranges))?;

That trait method is a provided method with a hard-coded default.

It would be preferable if we allowed for a user-configurable coalesce range. We can do this by just copying that function into get.rs and calling it instead of the trait.

    /// Return the bytes that are stored at the specified location
    /// in the given byte ranges
    async fn _get_ranges_impl(&self, location: &Path, ranges: &[Range<u64>], coalesce: usize) -> Result<Vec<Bytes>> {
        coalesce_ranges(
            ranges,
            |range| self.get_range(location, range), coalesce,
        )
        .await
    }

and then updating our get_ranges and get_ranges_async to take in a keyword-only optional parameter for the coalesce size.

cc @sharkinsspatial

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions