Skip to content

Commit 5448173

Browse files
authored
[Backport 2.x] Inject namedWriteableRegistry during ser/deser of SearchMonitorAction (#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]>
1 parent dd108c6 commit 5448173

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import org.opensearch.commons.alerting.model.Workflow
2626
import org.opensearch.commons.authuser.User
2727
import org.opensearch.commons.utils.recreateObject
2828
import org.opensearch.core.action.ActionListener
29+
import org.opensearch.core.common.io.stream.NamedWriteableRegistry
2930
import org.opensearch.index.query.BoolQueryBuilder
3031
import org.opensearch.index.query.ExistsQueryBuilder
3132
import org.opensearch.index.query.MatchQueryBuilder
@@ -40,8 +41,8 @@ class TransportSearchMonitorAction @Inject constructor(
4041
val settings: Settings,
4142
val client: Client,
4243
clusterService: ClusterService,
43-
actionFilters: ActionFilters
44-
44+
actionFilters: ActionFilters,
45+
val namedWriteableRegistry: NamedWriteableRegistry
4546
) : HandledTransportAction<ActionRequest, SearchResponse>(
4647
AlertingActions.SEARCH_MONITORS_ACTION_NAME, transportService, actionFilters, ::SearchMonitorRequest
4748
),
@@ -54,7 +55,7 @@ class TransportSearchMonitorAction @Inject constructor(
5455

5556
override fun doExecute(task: Task, request: ActionRequest, actionListener: ActionListener<SearchResponse>) {
5657
val transformedRequest = request as? SearchMonitorRequest
57-
?: recreateObject(request) {
58+
?: recreateObject(request, namedWriteableRegistry) {
5859
SearchMonitorRequest(it)
5960
}
6061

0 commit comments

Comments
 (0)