-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added function for request recreation that considers the writeable re… #303
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. |
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.
Thanks for catching this issue and fixing it Stevan. Left a couple minor comments
@@ -50,6 +51,31 @@ object AlertingPluginInterface { | |||
} | |||
) | |||
} | |||
/** |
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.
let's not overload index monitor method. Let's change the original method's signature
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.
Yeah sure. Tnx
randomBucketLevelMonitor() | ||
) | ||
|
||
val recreatedObject = recreateObject(req, NamedWriteableRegistry(SearchModule(Settings.EMPTY, emptyList()).namedWriteables)) { IndexMonitorRequest(it) } |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
#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.