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

Suggestion - Update 'setMetadata' method name to 'updateMetadata' #16191

Closed
abhikt48 opened this issue Oct 12, 2020 · 3 comments
Closed

Suggestion - Update 'setMetadata' method name to 'updateMetadata' #16191

abhikt48 opened this issue Oct 12, 2020 · 3 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@abhikt48
Copy link

We were using old microsoft SDK azure-storage:5.5.0 and exploring latest SDK azure-storage-blob:12.8.0 now as part of migration.

We were using 'setMetadata' operation to set metadata in old SDK. But in latest SDK 'setMetadata' updates the exiting values instead of adding values.

As per user point of view - 'setMetadata' method name misleads for setting the metadata.

I would like to request for updating the method name such as 'updateMetadata' to avoid confusion. Which will be more meaningful from user point of view.

BlobClient blobClient = blobContainerClient.getBlobClient(BLOB_NAME);
            Map<String, String> metadata = new HashMap<String, String>();
            metadata.put("FirstName", "ASOS");
          
            blobClient.setMetadata(metadata);
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 12, 2020
@abhikt48 abhikt48 changed the title Update 'setMetadata' method name to 'updateMetadata' Suggestion - Update 'setMetadata' method name to 'updateMetadata' Oct 12, 2020
@gapra-msft gapra-msft self-assigned this Oct 12, 2020
@gapra-msft
Copy link
Member

Hi @abhikt48,

Thanks for your suggestion. Unfortunately, changing the name of an existing API would be a breaking change.

We could, however, update the Javadoc to further clarify the behavior of the method.

Here is the current Javadoc.

Changes a blob's metadata. The specified metadata in this method will replace existing metadata. If old values
must be preserved, they must be downloaded and included in the call to this method.

Is there something specific you think isn't quite reflected in it's current form?

We would be happy to update the Javadoc to clarify the behavior.

@abhikt48
Copy link
Author

abhikt48 commented Oct 12, 2020

HI @gapra-msft - Java doc is much clear, i got to know about this from javaDoc itself. However we will get clearity once we deep down in SDK.
I can understand - updating the name would be breaking change.

Suggestion - Can we deprecate this method and update method name in New SDK ? Atleast this method will not mislead to new Developer.

What's your opinion?

@gapra-msft gapra-msft added the Storage Storage Service (Queues, Blobs, Files) label Oct 12, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 12, 2020
@gapra-msft
Copy link
Member

@abhikt48

We have architectural guidelines we need to follow.

Based off these, we decided the set prefix is the most appropriate prefix to use for this API.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

2 participants