Added function for request recreation that considers the writeable re…#303
Conversation
…gistry used for parsing the aggregations Added unit tests that checks if the bucket level monitor requests are created and ser/de correctly Signed-off-by: Stevan Buzejic <stevan.buzejic@htecgroup.com>
Codecov Report
@@ Coverage Diff @@
## main #303 +/- ##
============================================
+ Coverage 73.32% 73.37% +0.04%
- Complexity 696 697 +1
============================================
Files 110 110
Lines 4563 4564 +1
Branches 605 605
============================================
+ Hits 3346 3349 +3
+ Misses 966 965 -1
+ Partials 251 250 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
eirsep
left a comment
There was a problem hiding this comment.
Thanks for catching this issue and fixing it Stevan. Left a couple minor comments
| } | ||
| ) | ||
| } | ||
| /** |
There was a problem hiding this comment.
let's not overload index monitor method. Let's change the original method's signature
| randomBucketLevelMonitor() | ||
| ) | ||
|
|
||
| val recreatedObject = recreateObject(req, NamedWriteableRegistry(SearchModule(Settings.EMPTY, emptyList()).namedWriteables)) { IndexMonitorRequest(it) } |
There was a problem hiding this comment.
let's have a test method where recreate object method WITHOUT NamedWriteableRegistry fails and in the same method let's verify that recreate Object WITH NamedWriteableRegistry passes using an actual aggregation in IndexMonitorRequest.
There was a problem hiding this comment.
Good point. Let me try to do that
…consider scenario when recreation of aggregation monitor fails Signed-off-by: Stevan Buzejic <stevan.buzejic@htecgroup.com>
#303) (#304) * Added function for request recreation that considers the writeable registry used for parsing the aggregations Co-authored-by: Stevan Buzejic <stevan.buzejic@htecgroup.com> (cherry picked from commit 6a169f7) Co-authored-by: Stevan Buzejic <30922513+stevanbz@users.noreply.github.com> (cherry picked from commit 2b2f242)
opensearch-project#303) (opensearch-project#304) * Added function for request recreation that considers the writeable registry used for parsing the aggregations Co-authored-by: Stevan Buzejic <stevan.buzejic@htecgroup.com> (cherry picked from commit 6a169f7) Co-authored-by: Stevan Buzejic <30922513+stevanbz@users.noreply.github.com>
opensearch-project#303) (opensearch-project#304) * Added function for request recreation that considers the writeable registry used for parsing the aggregations Co-authored-by: Stevan Buzejic <stevan.buzejic@htecgroup.com> (cherry picked from commit 6a169f7) Co-authored-by: Stevan Buzejic <30922513+stevanbz@users.noreply.github.com> Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
…gistry used for parsing the aggregations
Added unit tests that checks if the bucket level monitor requests are created and ser/de correctly
Signed-off-by: Stevan Buzejic stevan.buzejic@htecgroup.com
Description
This PR enables serialization/de-serialization of bucket level monitors.
Adds two new methods - recreateObject which is responsible to re-create objects by using the namedWriteableRegistry
and indexMonitor - which calls recreateObject taking into the account namedWriteableRegistry
Issues Resolved
[List any issues this PR will resolve]
Check List
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.