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

Move id converter to router.deleteBlob #2907

Closed
wants to merge 1 commit into from

Conversation

SophieGuo410
Copy link
Contributor

No description provided.

@SophieGuo410 SophieGuo410 force-pushed the Branch_support_delete_withIdConverter branch 3 times, most recently from 2dc936f to d261465 Compare October 2, 2024 21:10
@SophieGuo410 SophieGuo410 force-pushed the Branch_support_delete_withIdConverter branch from d261465 to ab0a10d Compare October 2, 2024 23:28
@SophieGuo410 SophieGuo410 marked this pull request as ready for review October 2, 2024 23:28
String blobIdStr =
removeLeadingSlashIfNeeded(restRequest.getArgs().get(RestUtils.InternalKeys.BLOB_ID).toString());
proceedWithDelete(blobIdStr, serviceId, callback, futureResult, quotaChargeCallback);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if we can call idConverter.convert() all the time inside the router. For named blobs, it would return the converted blob ID. For regular blobs, it would remove leading slash. Then we wouldn't need if-else condition and removeLeadingSlashIfNeeded() method here. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logic wise I think it's doable, but I just want to avoid unnecessary network calls to mysql database, that's why I set this internal header to differentiate diff scenarios.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I think in our IdConverter logic, we only make calls to MySQL if it is named blobs. For regular blobs, it would just strip the slash

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.

3 participants