Skip to content

[Storage] [WIP] Handwritten BlockBlobClient #2505

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vincenttran-msft
Copy link
Member

@vincenttran-msft vincenttran-msft commented Apr 21, 2025

This is WIP and does not include any recordings. Currently a proof of concept to discuss some design questions regarding sub Blob clients.

Tests will fail in CI due to lack of recordings

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Apr 21, 2025
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure_storage_blob

/// * `options` - Optional configuration for the client.
pub fn get_block_blob_client(
&self,
options: Option<BlockBlobClientOptions>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a precedent on whether sub-clients should inherit options, or should they be explicitly set and default otherwise.

I think for Service vs. Container vs. Blob it makes sense to not be passing the options bag, but I could see the argument since these subclients are all Blob-based -- but wanted to see if we have any precedent in other languages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, will change this to block_blob_client as per subclient naming guidelines.

@@ -65,6 +65,7 @@ async fn test_get_blob_properties(ctx: TestContext) -> Result<(), Box<dyn Error>
let data = b"hello rusty world";

blob_client
.get_block_blob_client(None)?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE (applies to all lines in test code):

  • I just did a simple F+R to get the tests passing locally -- there is still tons of better practice things to do here such as use a common BlockBlobClient instance for multiple API calls etc. The PR ahead of this introduces tons of test helper utilities but I didn't want to block on an unrelated issue.

/// If False, the operation will fail with ResourceExistsError.
/// * `content_length` - Total length of the blob data to be uploaded.
/// * `options` - Optional configuration for the request.
pub async fn upload(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave this in base blob client.

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

Successfully merging this pull request may close these issues.

3 participants