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

feat(storage): support partial reads #93

Merged
merged 6 commits into from
Aug 22, 2023
Merged

feat(storage): support partial reads #93

merged 6 commits into from
Aug 22, 2023

Conversation

manzt
Copy link
Owner

@manzt manzt commented Aug 21, 2023

Introduces the Readable.getRange method, which can be optionally implemented by a store to support partial reads. The RangeQuery param is inspired by the HTTP Range header. Allowing the suffixLength query means the store can decide the best way to return the final N bytes from a file.

const store = new FetchStore("http://localhost:8080/data.zarr");
await store.getRange("/foo.json", { suffixLength: 100 });
await store.getRange("/foo.json", { offset: 10, length: 20 });

cc @andersy005

@manzt manzt merged commit b90fd33 into main Aug 22, 2023
@manzt manzt deleted the read-partial branch August 22, 2023 01:03
@github-actions github-actions bot mentioned this pull request Aug 22, 2023
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

Successfully merging this pull request may close these issues.

1 participant