From 27d7ea078a61ea76246479c6065567e7fccc0374 Mon Sep 17 00:00:00 2001 From: Ruirui Zhang Date: Thu, 3 Oct 2024 22:13:59 -0700 Subject: [PATCH] modify based on comments Signed-off-by: Ruirui Zhang --- .../org/opensearch/action/ActionModule.java | 10 +++---- ...tion.java => TransportWlmStatsAction.java} | 26 +++++++--------- ...upStatsAction.java => WlmStatsAction.java} | 10 +++---- ...StatsRequest.java => WlmStatsRequest.java} | 10 +++---- ...atsResponse.java => WlmStatsResponse.java} | 8 ++--- .../admin/cluster/wlm/package-info.java | 2 +- .../opensearch/client/ClusterAdminClient.java | 6 ++-- .../client/support/AbstractClient.java | 10 +++---- ...atsAction.java => RestWlmStatsAction.java} | 12 ++++---- ...eTests.java => WlmStatsResponseTests.java} | 16 +++------- ...java => TransportWlmStatsActionTests.java} | 30 +++++++++---------- 11 files changed, 63 insertions(+), 77 deletions(-) rename server/src/main/java/org/opensearch/action/admin/cluster/wlm/{TransportQueryGroupStatsAction.java => TransportWlmStatsAction.java} (67%) rename server/src/main/java/org/opensearch/action/admin/cluster/wlm/{QueryGroupStatsAction.java => WlmStatsAction.java} (57%) rename server/src/main/java/org/opensearch/action/admin/cluster/wlm/{QueryGroupStatsRequest.java => WlmStatsRequest.java} (82%) rename server/src/main/java/org/opensearch/action/admin/cluster/wlm/{QueryGroupStatsResponse.java => WlmStatsResponse.java} (85%) rename server/src/main/java/org/opensearch/rest/action/admin/cluster/{RestQueryGroupStatsAction.java => RestWlmStatsAction.java} (77%) rename server/src/test/java/org/opensearch/action/admin/cluster/wlm/{QueryGroupStatsResponseTests.java => WlmStatsResponseTests.java} (86%) rename server/src/test/java/org/opensearch/action/support/nodes/{TransportQueryGroupStatsActionTests.java => TransportWlmStatsActionTests.java} (62%) diff --git a/server/src/main/java/org/opensearch/action/ActionModule.java b/server/src/main/java/org/opensearch/action/ActionModule.java index 9713b2ea7496e..4d24bf9d35703 100644 --- a/server/src/main/java/org/opensearch/action/ActionModule.java +++ b/server/src/main/java/org/opensearch/action/ActionModule.java @@ -123,8 +123,8 @@ import org.opensearch.action.admin.cluster.storedscripts.TransportPutStoredScriptAction; import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksAction; import org.opensearch.action.admin.cluster.tasks.TransportPendingClusterTasksAction; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsAction; -import org.opensearch.action.admin.cluster.wlm.TransportQueryGroupStatsAction; +import org.opensearch.action.admin.cluster.wlm.TransportWlmStatsAction; +import org.opensearch.action.admin.cluster.wlm.WlmStatsAction; import org.opensearch.action.admin.indices.alias.IndicesAliasesAction; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.TransportIndicesAliasesAction; @@ -369,7 +369,6 @@ import org.opensearch.rest.action.admin.cluster.RestPendingClusterTasksAction; import org.opensearch.rest.action.admin.cluster.RestPutRepositoryAction; import org.opensearch.rest.action.admin.cluster.RestPutStoredScriptAction; -import org.opensearch.rest.action.admin.cluster.RestQueryGroupStatsAction; import org.opensearch.rest.action.admin.cluster.RestReloadSecureSettingsAction; import org.opensearch.rest.action.admin.cluster.RestRemoteClusterInfoAction; import org.opensearch.rest.action.admin.cluster.RestRemoteStoreStatsAction; @@ -377,6 +376,7 @@ import org.opensearch.rest.action.admin.cluster.RestRestoreSnapshotAction; import org.opensearch.rest.action.admin.cluster.RestSnapshotsStatusAction; import org.opensearch.rest.action.admin.cluster.RestVerifyRepositoryAction; +import org.opensearch.rest.action.admin.cluster.RestWlmStatsAction; import org.opensearch.rest.action.admin.cluster.dangling.RestDeleteDanglingIndexAction; import org.opensearch.rest.action.admin.cluster.dangling.RestImportDanglingIndexAction; import org.opensearch.rest.action.admin.cluster.dangling.RestListDanglingIndicesAction; @@ -614,7 +614,7 @@ public void reg actions.register(NodesInfoAction.INSTANCE, TransportNodesInfoAction.class); actions.register(RemoteInfoAction.INSTANCE, TransportRemoteInfoAction.class); actions.register(NodesStatsAction.INSTANCE, TransportNodesStatsAction.class); - actions.register(QueryGroupStatsAction.INSTANCE, TransportQueryGroupStatsAction.class); + actions.register(WlmStatsAction.INSTANCE, TransportWlmStatsAction.class); actions.register(RemoteStoreStatsAction.INSTANCE, TransportRemoteStoreStatsAction.class); actions.register(NodesUsageAction.INSTANCE, TransportNodesUsageAction.class); actions.register(NodesHotThreadsAction.INSTANCE, TransportNodesHotThreadsAction.class); @@ -816,7 +816,7 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestClearVotingConfigExclusionsAction()); registerHandler.accept(new RestMainAction()); registerHandler.accept(new RestNodesInfoAction(settingsFilter)); - registerHandler.accept(new RestQueryGroupStatsAction()); + registerHandler.accept(new RestWlmStatsAction()); registerHandler.accept(new RestRemoteClusterInfoAction()); registerHandler.accept(new RestNodesStatsAction()); registerHandler.accept(new RestNodesUsageAction()); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/TransportQueryGroupStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/TransportWlmStatsAction.java similarity index 67% rename from server/src/main/java/org/opensearch/action/admin/cluster/wlm/TransportQueryGroupStatsAction.java rename to server/src/main/java/org/opensearch/action/admin/cluster/wlm/TransportWlmStatsAction.java index 583f06d08967f..1f8b48b11ab8e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/TransportQueryGroupStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/TransportWlmStatsAction.java @@ -27,16 +27,12 @@ * * @opensearch.experimental */ -public class TransportQueryGroupStatsAction extends TransportNodesAction< - QueryGroupStatsRequest, - QueryGroupStatsResponse, - QueryGroupStatsRequest, - QueryGroupStats> { +public class TransportWlmStatsAction extends TransportNodesAction { QueryGroupService queryGroupService; @Inject - public TransportQueryGroupStatsAction( + public TransportWlmStatsAction( ThreadPool threadPool, ClusterService clusterService, TransportService transportService, @@ -44,13 +40,13 @@ public TransportQueryGroupStatsAction( ActionFilters actionFilters ) { super( - QueryGroupStatsAction.NAME, + WlmStatsAction.NAME, threadPool, clusterService, transportService, actionFilters, - QueryGroupStatsRequest::new, - QueryGroupStatsRequest::new, + WlmStatsRequest::new, + WlmStatsRequest::new, ThreadPool.Names.MANAGEMENT, QueryGroupStats.class ); @@ -58,16 +54,16 @@ public TransportQueryGroupStatsAction( } @Override - protected QueryGroupStatsResponse newResponse( - QueryGroupStatsRequest request, + protected WlmStatsResponse newResponse( + WlmStatsRequest request, List queryGroupStats, List failures ) { - return new QueryGroupStatsResponse(clusterService.getClusterName(), queryGroupStats, failures); + return new WlmStatsResponse(clusterService.getClusterName(), queryGroupStats, failures); } @Override - protected QueryGroupStatsRequest newNodeRequest(QueryGroupStatsRequest request) { + protected WlmStatsRequest newNodeRequest(WlmStatsRequest request) { return request; } @@ -77,7 +73,7 @@ protected QueryGroupStats newNodeResponse(StreamInput in) throws IOException { } @Override - protected QueryGroupStats nodeOperation(QueryGroupStatsRequest queryGroupStatsRequest) { - return queryGroupService.nodeStats(queryGroupStatsRequest.getQueryGroupIds(), queryGroupStatsRequest.isBreach()); + protected QueryGroupStats nodeOperation(WlmStatsRequest wlmStatsRequest) { + return queryGroupService.nodeStats(wlmStatsRequest.getQueryGroupIds(), wlmStatsRequest.isBreach()); } } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsAction.java similarity index 57% rename from server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsAction.java rename to server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsAction.java index bb865aab28521..426ca1bd13708 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsAction.java @@ -11,15 +11,15 @@ import org.opensearch.action.ActionType; /** - * Transport action for obtaining QueryGroup Stats. + * Transport action for obtaining Workload Management Stats. * * @opensearch.experimental */ -public class QueryGroupStatsAction extends ActionType { - public static final QueryGroupStatsAction INSTANCE = new QueryGroupStatsAction(); +public class WlmStatsAction extends ActionType { + public static final WlmStatsAction INSTANCE = new WlmStatsAction(); public static final String NAME = "cluster:monitor/query_group_stats"; - private QueryGroupStatsAction() { - super(NAME, QueryGroupStatsResponse::new); + private WlmStatsAction() { + super(NAME, WlmStatsResponse::new); } } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java similarity index 82% rename from server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsRequest.java rename to server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java index 66bd7df5a1adc..a09ea329d9a98 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java @@ -18,15 +18,15 @@ import java.util.Set; /** - * A request to get QueryGroupStats + * A request to get Workload Management Stats */ @ExperimentalApi -public class QueryGroupStatsRequest extends BaseNodesRequest { +public class WlmStatsRequest extends BaseNodesRequest { private final Set queryGroupIds; private final Boolean breach; - public QueryGroupStatsRequest(StreamInput in) throws IOException { + public WlmStatsRequest(StreamInput in) throws IOException { super(in); this.queryGroupIds = new HashSet<>(Set.of(in.readStringArray())); this.breach = in.readOptionalBoolean(); @@ -36,13 +36,13 @@ public QueryGroupStatsRequest(StreamInput in) throws IOException { * Get QueryGroup stats from nodes based on the nodes ids specified. If none are passed, stats * for all nodes will be returned. */ - public QueryGroupStatsRequest(String[] nodesIds, Set queryGroupIds, boolean breach) { + public WlmStatsRequest(String[] nodesIds, Set queryGroupIds, boolean breach) { super(false, nodesIds); this.queryGroupIds = queryGroupIds; this.breach = breach; } - public QueryGroupStatsRequest() { + public WlmStatsRequest() { super(false, (String[]) null); queryGroupIds = new HashSet<>(); this.breach = false; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java similarity index 85% rename from server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsResponse.java rename to server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java index 8fa958a97634f..1175abc462c8e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java @@ -23,16 +23,16 @@ import java.util.List; /** - * A response for obtaining QueryGroupStats + * A response for obtaining Workload Management Stats */ @ExperimentalApi -public class QueryGroupStatsResponse extends BaseNodesResponse implements ToXContentFragment { +public class WlmStatsResponse extends BaseNodesResponse implements ToXContentFragment { - QueryGroupStatsResponse(StreamInput in) throws IOException { + WlmStatsResponse(StreamInput in) throws IOException { super(in); } - QueryGroupStatsResponse(ClusterName clusterName, List nodes, List failures) { + WlmStatsResponse(ClusterName clusterName, List nodes, List failures) { super(clusterName, nodes, failures); } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/package-info.java index 0dc98d45c5e5f..13724b335e7c6 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/wlm/package-info.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/wlm/package-info.java @@ -6,5 +6,5 @@ * compatible open source license. */ -/** QueryGroupStats transport handlers. */ +/** WlmStats transport handlers. */ package org.opensearch.action.admin.cluster.wlm; diff --git a/server/src/main/java/org/opensearch/client/ClusterAdminClient.java b/server/src/main/java/org/opensearch/client/ClusterAdminClient.java index ac43e53e9b4b7..db65415eace2e 100644 --- a/server/src/main/java/org/opensearch/client/ClusterAdminClient.java +++ b/server/src/main/java/org/opensearch/client/ClusterAdminClient.java @@ -137,8 +137,8 @@ import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksRequest; import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksRequestBuilder; import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksResponse; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsRequest; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsResponse; +import org.opensearch.action.admin.cluster.wlm.WlmStatsRequest; +import org.opensearch.action.admin.cluster.wlm.WlmStatsResponse; import org.opensearch.action.admin.indices.dangling.delete.DeleteDanglingIndexRequest; import org.opensearch.action.admin.indices.dangling.import_index.ImportDanglingIndexRequest; import org.opensearch.action.admin.indices.dangling.list.ListDanglingIndicesRequest; @@ -328,7 +328,7 @@ public interface ClusterAdminClient extends OpenSearchClient { * @param request The QueryGroupStatsRequest * @param listener A listener to be notified with a result */ - void queryGroupStats(QueryGroupStatsRequest request, ActionListener listener); + void wlmStats(WlmStatsRequest request, ActionListener listener); void remoteStoreStats(RemoteStoreStatsRequest request, ActionListener listener); diff --git a/server/src/main/java/org/opensearch/client/support/AbstractClient.java b/server/src/main/java/org/opensearch/client/support/AbstractClient.java index 9bd6c76ef829c..f4683ab516cef 100644 --- a/server/src/main/java/org/opensearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/opensearch/client/support/AbstractClient.java @@ -179,9 +179,9 @@ import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksRequest; import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksRequestBuilder; import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksResponse; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsAction; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsRequest; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsResponse; +import org.opensearch.action.admin.cluster.wlm.WlmStatsAction; +import org.opensearch.action.admin.cluster.wlm.WlmStatsRequest; +import org.opensearch.action.admin.cluster.wlm.WlmStatsResponse; import org.opensearch.action.admin.indices.alias.IndicesAliasesAction; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequestBuilder; @@ -922,8 +922,8 @@ public NodesStatsRequestBuilder prepareNodesStats(String... nodesIds) { } @Override - public void queryGroupStats(final QueryGroupStatsRequest request, final ActionListener listener) { - execute(QueryGroupStatsAction.INSTANCE, request, listener); + public void wlmStats(final WlmStatsRequest request, final ActionListener listener) { + execute(WlmStatsAction.INSTANCE, request, listener); } @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestQueryGroupStatsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestWlmStatsAction.java similarity index 77% rename from server/src/main/java/org/opensearch/rest/action/admin/cluster/RestQueryGroupStatsAction.java rename to server/src/main/java/org/opensearch/rest/action/admin/cluster/RestWlmStatsAction.java index 9def1a278f03e..fb0dbfe68f920 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestQueryGroupStatsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestWlmStatsAction.java @@ -8,7 +8,7 @@ package org.opensearch.rest.action.admin.cluster; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsRequest; +import org.opensearch.action.admin.cluster.wlm.WlmStatsRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.core.common.Strings; import org.opensearch.rest.BaseRestHandler; @@ -24,11 +24,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; /** - * Transport action to get QueryGroup stats + * Transport action to get Workload Management stats * * @opensearch.experimental */ -public class RestQueryGroupStatsAction extends BaseRestHandler { +public class RestWlmStatsAction extends BaseRestHandler { @Override public List routes() { @@ -52,9 +52,7 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli String[] nodesIds = Strings.splitStringByCommaToArray(request.param("nodeId")); Set queryGroupIds = Strings.tokenizeByCommaToSet(request.param("queryGroupId", "_all")); Boolean breach = request.hasParam("breach") ? Boolean.parseBoolean(request.param("boolean")) : null; - QueryGroupStatsRequest queryGroupStatsRequest = new QueryGroupStatsRequest(nodesIds, queryGroupIds, breach); - return channel -> client.admin() - .cluster() - .queryGroupStats(queryGroupStatsRequest, new RestActions.NodesResponseRestListener<>(channel)); + WlmStatsRequest wlmStatsRequest = new WlmStatsRequest(nodesIds, queryGroupIds, breach); + return channel -> client.admin().cluster().wlmStats(wlmStatsRequest, new RestActions.NodesResponseRestListener<>(channel)); } } diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/wlm/WlmStatsResponseTests.java similarity index 86% rename from server/src/test/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/wlm/WlmStatsResponseTests.java index b09f05e839ac3..84c202398caae 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/wlm/QueryGroupStatsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/wlm/WlmStatsResponseTests.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.Set; -public class QueryGroupStatsResponseTests extends OpenSearchTestCase { +public class WlmStatsResponseTests extends OpenSearchTestCase { ClusterName clusterName = new ClusterName("test-cluster"); String testQueryGroupId = "safjgagnaeekg-3r3fads"; DiscoveryNode node = new DiscoveryNode( @@ -59,25 +59,17 @@ public class QueryGroupStatsResponseTests extends OpenSearchTestCase { List failedNodeExceptionList = new ArrayList<>(); public void testSerializationAndDeserialization() throws IOException { - QueryGroupStatsResponse queryGroupStatsResponse = new QueryGroupStatsResponse( - clusterName, - queryGroupStatsList, - failedNodeExceptionList - ); + WlmStatsResponse queryGroupStatsResponse = new WlmStatsResponse(clusterName, queryGroupStatsList, failedNodeExceptionList); BytesStreamOutput out = new BytesStreamOutput(); queryGroupStatsResponse.writeTo(out); StreamInput in = out.bytes().streamInput(); - QueryGroupStatsResponse deserializedResponse = new QueryGroupStatsResponse(in); + WlmStatsResponse deserializedResponse = new WlmStatsResponse(in); assertEquals(queryGroupStatsResponse.getClusterName(), deserializedResponse.getClusterName()); assertEquals(queryGroupStatsResponse.getNodes().size(), deserializedResponse.getNodes().size()); } public void testToString() { - QueryGroupStatsResponse queryGroupStatsResponse = new QueryGroupStatsResponse( - clusterName, - queryGroupStatsList, - failedNodeExceptionList - ); + WlmStatsResponse queryGroupStatsResponse = new WlmStatsResponse(clusterName, queryGroupStatsList, failedNodeExceptionList); String responseString = queryGroupStatsResponse.toString(); assertEquals( "{\n" diff --git a/server/src/test/java/org/opensearch/action/support/nodes/TransportQueryGroupStatsActionTests.java b/server/src/test/java/org/opensearch/action/support/nodes/TransportWlmStatsActionTests.java similarity index 62% rename from server/src/test/java/org/opensearch/action/support/nodes/TransportQueryGroupStatsActionTests.java rename to server/src/test/java/org/opensearch/action/support/nodes/TransportWlmStatsActionTests.java index 9079410983dfd..49d2cc4d23e62 100644 --- a/server/src/test/java/org/opensearch/action/support/nodes/TransportQueryGroupStatsActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/nodes/TransportWlmStatsActionTests.java @@ -8,8 +8,8 @@ package org.opensearch.action.support.nodes; -import org.opensearch.action.admin.cluster.wlm.QueryGroupStatsRequest; -import org.opensearch.action.admin.cluster.wlm.TransportQueryGroupStatsAction; +import org.opensearch.action.admin.cluster.wlm.TransportWlmStatsAction; +import org.opensearch.action.admin.cluster.wlm.WlmStatsRequest; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.common.io.stream.BytesStreamOutput; @@ -26,15 +26,15 @@ import static org.mockito.Mockito.mock; -public class TransportQueryGroupStatsActionTests extends TransportNodesActionTests { +public class TransportWlmStatsActionTests extends TransportNodesActionTests { /** * We don't want to send discovery nodes list to each request that is sent across from the coordinator node. * This behavior is asserted in this test. */ - public void testQueryGroupStatsActionWithRetentionOfDiscoveryNodesList() { - QueryGroupStatsRequest request = new QueryGroupStatsRequest(); - Map> combinedSentRequest = performQueryGroupStatsAction(request); + public void testWlmStatsActionWithRetentionOfDiscoveryNodesList() { + WlmStatsRequest request = new WlmStatsRequest(); + Map> combinedSentRequest = performWlmStatsAction(request); assertNotNull(combinedSentRequest); combinedSentRequest.forEach((node, capturedRequestList) -> { @@ -43,30 +43,30 @@ public void testQueryGroupStatsActionWithRetentionOfDiscoveryNodesList() { }); } - private Map> performQueryGroupStatsAction(QueryGroupStatsRequest request) { - TransportNodesAction action = new TransportQueryGroupStatsAction( + private Map> performWlmStatsAction(WlmStatsRequest request) { + TransportNodesAction action = new TransportWlmStatsAction( THREAD_POOL, clusterService, transportService, mock(QueryGroupService.class), new ActionFilters(Collections.emptySet()) ); - PlainActionFuture listener = new PlainActionFuture<>(); + PlainActionFuture listener = new PlainActionFuture<>(); action.new AsyncAction(null, request, listener).start(); Map> capturedRequests = transport.getCapturedRequestsByTargetNodeAndClear(); - Map> combinedSentRequest = new HashMap<>(); + Map> combinedSentRequest = new HashMap<>(); capturedRequests.forEach((node, capturedRequestList) -> { - List sentRequestList = new ArrayList<>(); + List sentRequestList = new ArrayList<>(); capturedRequestList.forEach(preSentRequest -> { BytesStreamOutput out = new BytesStreamOutput(); try { - QueryGroupStatsRequest QueryGroupStatsRequestFromCoordinator = (QueryGroupStatsRequest) preSentRequest.request; - QueryGroupStatsRequestFromCoordinator.writeTo(out); + WlmStatsRequest wlmStatsRequestFromCoordinator = (WlmStatsRequest) preSentRequest.request; + wlmStatsRequestFromCoordinator.writeTo(out); StreamInput in = out.bytes().streamInput(); - QueryGroupStatsRequest QueryGroupStatsRequest = new QueryGroupStatsRequest(in); - sentRequestList.add(QueryGroupStatsRequest); + WlmStatsRequest wlmStatsRequest = new WlmStatsRequest(in); + sentRequestList.add(wlmStatsRequest); } catch (IOException e) { throw new RuntimeException(e); }