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

[FEATURE REQ] StorageSeekableByteChannel #32014

Open
4 of 8 tasks
jaschrep-msft opened this issue Nov 8, 2022 · 1 comment
Open
4 of 8 tasks

[FEATURE REQ] StorageSeekableByteChannel #32014

jaschrep-msft opened this issue Nov 8, 2022 · 1 comment
Labels
Storage Storage Service (Queues, Blobs, Files)

Comments

@jaschrep-msft
Copy link
Member

jaschrep-msft commented Nov 8, 2022

Is your feature request related to a problem? Please describe.
StorageInputStream currently provides a low-memory-footprint mechanism to provide a seekable view of bytes in a Storage resource via mark(int) and reset(). Unfortunately, mark() is limited to max int, whereas long values are fully supportable in this situation.

Further, azure-storage-blob-nio must support a SeekableByteChannel. It currently depends on StorageInputStream as an implementation, and so is subject to those same limits, despite the API of the class suggesting it should not be. To support long-value seeking, blob nio must implement its own SeekableByteChannel, but it would be best to have this implementation in the main storage packages.

Describe the solution you'd like
azure-storage-common transition its StorageInputStream and StorageOutputStream implementations to a StorageSeekableByteChannel implementation, leaving the old classes as facade over the new channel class. Service packages adopt their implementations appropriately. Channels could only be opened in read mode or write mode (something Java implementations are fine doing).

Describe alternatives you've considered
Alternatives aren't viable as the limitation is in the mark/reset API from Java.

Additional context
Need prompted by #31924

Progress

@jaschrep-msft jaschrep-msft added the Storage Storage Service (Queues, Blobs, Files) label Nov 8, 2022
@sebastianhorn1
Copy link

Dear jaschrep,
thank you for the evaluation you have done. Regarding my problem for me it would be more important that at the end the soulution implements the SeekableByteChannel Interface from java.nio because my solution only relyes on this interface.

Hope that describes it well
Kind Regards
Sebastian Horn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

2 participants