From 54481736f02b6faf35b3999abddf1a72d16f134f Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Mon, 22 Jan 2024 12:04:44 -0800 Subject: [PATCH] [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 * remove bin files Signed-off-by: Tyler Ohlsen * remove core bin Signed-off-by: Tyler Ohlsen --------- Signed-off-by: Tyler Ohlsen --- .../alerting/transport/TransportSearchMonitorAction.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt index bdaa7e1cc..7359d60ea 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt @@ -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( 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) { val transformedRequest = request as? SearchMonitorRequest - ?: recreateObject(request) { + ?: recreateObject(request, namedWriteableRegistry) { SearchMonitorRequest(it) }