|
51 | 51 | import org.opensearch.action.search.SearchRequestOperationsListener;
|
52 | 52 | import org.opensearch.action.search.SearchRequestSlowLog;
|
53 | 53 | import org.opensearch.action.search.SearchRequestStats;
|
| 54 | +import org.opensearch.action.search.SearchTaskRequestOperationsListener; |
54 | 55 | import org.opensearch.action.search.SearchTransportService;
|
55 | 56 | import org.opensearch.action.support.TransportAction;
|
56 | 57 | import org.opensearch.action.update.UpdateHelper;
|
@@ -852,8 +853,17 @@ protected Node(
|
852 | 853 | threadPool
|
853 | 854 | );
|
854 | 855 |
|
| 856 | + final TaskResourceTrackingService taskResourceTrackingService = new TaskResourceTrackingService( |
| 857 | + settings, |
| 858 | + clusterService.getClusterSettings(), |
| 859 | + threadPool |
| 860 | + ); |
| 861 | + |
855 | 862 | final SearchRequestStats searchRequestStats = new SearchRequestStats(clusterService.getClusterSettings());
|
856 | 863 | final SearchRequestSlowLog searchRequestSlowLog = new SearchRequestSlowLog(clusterService);
|
| 864 | + final SearchTaskRequestOperationsListener searchTaskRequestOperationsListener = new SearchTaskRequestOperationsListener( |
| 865 | + taskResourceTrackingService |
| 866 | + ); |
857 | 867 |
|
858 | 868 | remoteStoreStatsTrackerFactory = new RemoteStoreStatsTrackerFactory(clusterService, settings);
|
859 | 869 | CacheModule cacheModule = new CacheModule(pluginsService.filterPlugins(CachePlugin.class), settings);
|
@@ -982,7 +992,7 @@ protected Node(
|
982 | 992 | final SearchRequestOperationsCompositeListenerFactory searchRequestOperationsCompositeListenerFactory =
|
983 | 993 | new SearchRequestOperationsCompositeListenerFactory(
|
984 | 994 | Stream.concat(
|
985 |
| - Stream.of(searchRequestStats, searchRequestSlowLog), |
| 995 | + Stream.of(searchRequestStats, searchRequestSlowLog, searchTaskRequestOperationsListener), |
986 | 996 | pluginComponents.stream()
|
987 | 997 | .filter(p -> p instanceof SearchRequestOperationsListener)
|
988 | 998 | .map(p -> (SearchRequestOperationsListener) p)
|
@@ -1110,12 +1120,6 @@ protected Node(
|
1110 | 1120 | // development. Then we can deprecate Getter and Setter for IndexingPressureService in ClusterService (#478).
|
1111 | 1121 | clusterService.setIndexingPressureService(indexingPressureService);
|
1112 | 1122 |
|
1113 |
| - final TaskResourceTrackingService taskResourceTrackingService = new TaskResourceTrackingService( |
1114 |
| - settings, |
1115 |
| - clusterService.getClusterSettings(), |
1116 |
| - threadPool |
1117 |
| - ); |
1118 |
| - |
1119 | 1123 | final SearchBackpressureSettings searchBackpressureSettings = new SearchBackpressureSettings(
|
1120 | 1124 | settings,
|
1121 | 1125 | clusterService.getClusterSettings()
|
|
0 commit comments