-
Notifications
You must be signed in to change notification settings - Fork 275
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
Conversation
d261465
to
ab0a10d
Compare
String blobIdStr = | ||
removeLeadingSlashIfNeeded(restRequest.getArgs().get(RestUtils.InternalKeys.BLOB_ID).toString()); | ||
proceedWithDelete(blobIdStr, serviceId, callback, futureResult, quotaChargeCallback); | ||
} else { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
b009e0a
to
1038f94
Compare
1038f94
to
aae3cb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.