-
Notifications
You must be signed in to change notification settings - Fork 80
Add action to /_acknowledge/alerts api #236
Conversation
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
============================================
+ Coverage 76.96% 77.78% +0.81%
- Complexity 157 164 +7
============================================
Files 75 79 +4
Lines 2809 3043 +234
Branches 430 447 +17
============================================
+ Hits 2162 2367 +205
- Misses 428 440 +12
- Partials 219 236 +17
Continue to review full report at Codecov.
|
constructor(sin: StreamInput) : super() { | ||
this.acknowledged = Collections.unmodifiableList(sin.readList(::Alert)) | ||
this.failed = Collections.unmodifiableList(sin.readList(::Alert)) | ||
this.missing = sin.readStringList() |
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.
Why should this be left as mutable?
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 catch, fixed.
sin.readInstant(), | ||
sin.readString() |
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.
Label these with the attribute names to keep the documentation consistent throughout the package and please do so everywhere else in this PR.
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.
Added comments
client.search(searchRequest, object : ActionListener<SearchResponse> { | ||
override fun onResponse(response: SearchResponse) { | ||
onSearchResponse(response) | ||
} | ||
|
||
override fun onFailure(t: Exception) { | ||
actionListener.onFailure(t) | ||
} | ||
}) |
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.
Just curious, why not continue using the wrap
function for ActionListener
, so it will be like:
client.search(searchRequest, ActionListener<SearchResponse>.wrap(::onSearchResponse, ::onFailure))
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 started this pattern mainly to customize exception and returned rest status with onFailure. Something like:
actionListener.onFailure(ElasticsearchStatusException("my error msg",RestStatus.INTERNAL_SERVER_ERROR))
* Add action to /_acknowledge/alerts api
Issue #, if available:
#232
Description of changes:
#232
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.