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

Changes to read raw resource from blob #4868

Draft
wants to merge 11 commits into
base: feature-branch/raw-resource-split
Choose a base branch
from

Conversation

paorodma-ms
Copy link
Contributor

Description

Describe the changes in this PR.

Related issues

Addresses [issue #].

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

foreach (int offset in offsets)
{
// Set reading position to offset
blobStream.Seek(offset, SeekOrigin.Begin);
Copy link

@gunjitchhhatwal gunjitchhhatwal Mar 25, 2025

Choose a reason for hiding this comment

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

does this stream allow seek?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does. I have added check.

Choose a reason for hiding this comment

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

Could you please any docs or steps how you checked. Just want to be sure since I was trying to use it this way and it did not let me. Also want to make sure I was not doing something wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this in the code:
if (!blobStream.CanSeek)
{
throw new NotSupportedException("This stream does not support seeking");
}

And tested with unit tests.

…m blob storage. Sorted offsets in ascending order before going through the blob file. Added unit tests and small test file to debug unit tests.
Simplified unit tests
Removed FakeResponse
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.

2 participants