-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Storage InputStream and OutputStream #5455
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been extracted away to work with more than just blobs.
5559441 to
62b1d69
Compare
| * @throws StorageException An exception representing any error which occurred during the operation. | ||
| */ | ||
| BlobInputStream(final BlobAsyncClientBase blobClient, final BlobAccessConditions accessCondition) | ||
| BlobInputStream(final BlobAsyncClient blobClient, final BlobAccessConditions accessCondition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be just BlobClient. Streams are used in the sync world, so it doesn't make sense to require a customer to pass in an async client, especially since we always block anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to sync will dramatically change the PR, which we can not fit the PR before Friday.
Async to Sync client change is an internal implementation change, so it is ok to do a post preview PR if it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this feedback be addressed by adding a BlobsyncClient overload in a later update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only private or protected method and constructor needs to update for this change. Our public APIs do not take client as param. We can simply change to sync instead of adding sync overload.
sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageInputStream.java
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageInputStream.java
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageInputStream.java
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageInputStream.java
Outdated
Show resolved
Hide resolved
| * @param fileRangeLength How much data the stream should return after fileRangeOffset. | ||
| * @throws StorageException An exception representing any error which occurred during the operation. | ||
| */ | ||
| StorageFileInputStream(final FileAsyncClient fileAsyncClient, long fileRangeOffset, Long fileRangeLength) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileAsyncClient [](start = 33, length = 15)
sync client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer no change for this PR before preview
...storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageOutputStream.java
Outdated
Show resolved
Hide resolved
...storage/azure-storage-common/src/main/java/com/azure/storage/common/StorageOutputStream.java
Outdated
Show resolved
Hide resolved
I think if you make commit() an abstract method on the base and then have it be a no op on the file output stream, then you don't have to duplicate any of this. This whole thing can move into the base. Refers to: sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobOutputStream.java:80 in 0aa814b. [](commit_id = 0aa814b, deletion_comment = False) |
@rickle-msft Could you clarify which is the base BlobOutputStream or StorageOutputStream? I did not find commit() in StorageFileOutputStream, It is an abstract in BlobOutputStream and only used by blockBlobStream. The reason I cannot move to the base is it asks for client which is only available in child stream. |
|
/azp run java - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The PR is to abstract storage input and output stream into common layer. Implemented StorageFileInputStream and StorageFileOutputStream. Make BlobInputStream and BlobOutputStream extends the common one.
Todo list: