Skip to content

Commit

Permalink
[Backport 2.x] Inject namedWriteableRegistry during ser/deser of Sear…
Browse files Browse the repository at this point in the history
…chMonitorAction (#1382) (#1384)

* Inject namedWriteableRegistry during ser/deser of SearchMonitorAction (#1382)

Signed-off-by: Tyler Ohlsen <[email protected]>

* remove bin files

Signed-off-by: Tyler Ohlsen <[email protected]>

* remove core bin

Signed-off-by: Tyler Ohlsen <[email protected]>

---------

Signed-off-by: Tyler Ohlsen <[email protected]>
ohltyler authored Jan 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent dd108c6 commit 5448173
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ import org.opensearch.commons.alerting.model.Workflow
import org.opensearch.commons.authuser.User
import org.opensearch.commons.utils.recreateObject
import org.opensearch.core.action.ActionListener
import org.opensearch.core.common.io.stream.NamedWriteableRegistry
import org.opensearch.index.query.BoolQueryBuilder
import org.opensearch.index.query.ExistsQueryBuilder
import org.opensearch.index.query.MatchQueryBuilder
@@ -40,8 +41,8 @@ class TransportSearchMonitorAction @Inject constructor(
val settings: Settings,
val client: Client,
clusterService: ClusterService,
actionFilters: ActionFilters

actionFilters: ActionFilters,
val namedWriteableRegistry: NamedWriteableRegistry
) : HandledTransportAction<ActionRequest, SearchResponse>(
AlertingActions.SEARCH_MONITORS_ACTION_NAME, transportService, actionFilters, ::SearchMonitorRequest
),
@@ -54,7 +55,7 @@ class TransportSearchMonitorAction @Inject constructor(

override fun doExecute(task: Task, request: ActionRequest, actionListener: ActionListener<SearchResponse>) {
val transformedRequest = request as? SearchMonitorRequest
?: recreateObject(request) {
?: recreateObject(request, namedWriteableRegistry) {
SearchMonitorRequest(it)
}

0 comments on commit 5448173

Please sign in to comment.