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

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

SophieGuo410
Copy link
Contributor

No description provided.

@SophieGuo410 SophieGuo410 force-pushed the Branch_support_delete_withIdConverter branch 4 times, most recently 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@SophieGuo410 SophieGuo410 reopened this Oct 31, 2024
@SophieGuo410 SophieGuo410 force-pushed the Branch_support_delete_withIdConverter branch from b009e0a to 1038f94 Compare October 31, 2024 05:24
@SophieGuo410 SophieGuo410 force-pushed the Branch_support_delete_withIdConverter branch from 1038f94 to aae3cb4 Compare October 31, 2024 05:49
Copy link
Collaborator

@justinlin-linkedin justinlin-linkedin left a comment

Choose a reason for hiding this comment

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

LGTM

@SophieGuo410 SophieGuo410 merged commit 5d099dc into master Nov 1, 2024
5 checks passed
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.

4 participants