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]>
  • Loading branch information
ohltyler authored Jan 22, 2024
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
Expand Up @@ -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
Expand All @@ -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
),
Expand All @@ -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)
}

Expand Down

0 comments on commit 5448173

Please sign in to comment.