-
Notifications
You must be signed in to change notification settings - Fork 147
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
adding tenantID to the request + implement multi-tenancy in undeploy api #3425
Conversation
41cfcde
to
32cc06b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3425 +/- ##
============================================
- Coverage 81.31% 80.29% -1.02%
- Complexity 6094 6695 +601
============================================
Files 573 599 +26
Lines 25268 29137 +3869
Branches 2666 3224 +558
============================================
+ Hits 20547 23397 +2850
- Misses 3601 4340 +739
- Partials 1120 1400 +280
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
32cc06b
to
c697a5b
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 with one nit
@@ -68,7 +68,7 @@ public void parseSearchQueryInput(MLInputDataset mlInputDataset, ActionListener< | |||
listener.onResponse(dfInputDataset); | |||
return; | |||
}, e -> { | |||
log.error("Failed to search" + e); | |||
log.error("Failed to search{}", e); |
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.
There's nothing to substitute here?
); | ||
|
||
client.execute(MLUndeployModelsAction.INSTANCE, mlUndeployModelsRequest, ActionListener.wrap(r -> { | ||
MLUndeployModelNodesResponse mlUndeployModelNodesResponse = r.getResponse(); | ||
if (mlUndeployModelNodesResponse.failures() != null && mlUndeployModelNodesResponse.failures().size() != 0) { | ||
if (mlUndeployModelNodesResponse.failures() != null && !mlUndeployModelNodesResponse.failures().isEmpty()) { |
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.
What's the reason for this change? To avoid NPE?
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.
better for Readability
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.
it's also nanoseconds faster to check empty vs. actually getting the size which requires iteration.
Here's a benchmark. The improvement is trivial but it's generally a good change. :)
https://salesforce.stackexchange.com/questions/68728/efficiency-of-list-size-0-vs-list-isempty
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> (cherry picked from commit af96fe0)
Description
[adding tenantID to the request + implement multi-tenancy in undeploy api]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.