|
52 | 52 | import org.opensearch.action.search.SearchRequestOperationsListener;
|
53 | 53 | import org.opensearch.action.search.SearchRequestSlowLog;
|
54 | 54 | import org.opensearch.action.search.SearchRequestStats;
|
| 55 | +import org.opensearch.action.search.SearchTaskRequestOperationsListener; |
55 | 56 | import org.opensearch.action.search.SearchTransportService;
|
56 | 57 | import org.opensearch.action.support.TransportAction;
|
57 | 58 | import org.opensearch.action.update.UpdateHelper;
|
@@ -855,8 +856,17 @@ protected Node(
|
855 | 856 | threadPool
|
856 | 857 | );
|
857 | 858 |
|
| 859 | + final TaskResourceTrackingService taskResourceTrackingService = new TaskResourceTrackingService( |
| 860 | + settings, |
| 861 | + clusterService.getClusterSettings(), |
| 862 | + threadPool |
| 863 | + ); |
| 864 | + |
858 | 865 | final SearchRequestStats searchRequestStats = new SearchRequestStats(clusterService.getClusterSettings());
|
859 | 866 | final SearchRequestSlowLog searchRequestSlowLog = new SearchRequestSlowLog(clusterService);
|
| 867 | + final SearchTaskRequestOperationsListener searchTaskRequestOperationsListener = new SearchTaskRequestOperationsListener( |
| 868 | + taskResourceTrackingService |
| 869 | + ); |
860 | 870 |
|
861 | 871 | remoteStoreStatsTrackerFactory = new RemoteStoreStatsTrackerFactory(clusterService, settings);
|
862 | 872 | CacheModule cacheModule = new CacheModule(pluginsService.filterPlugins(CachePlugin.class), settings);
|
@@ -988,7 +998,7 @@ protected Node(
|
988 | 998 | final SearchRequestOperationsCompositeListenerFactory searchRequestOperationsCompositeListenerFactory =
|
989 | 999 | new SearchRequestOperationsCompositeListenerFactory(
|
990 | 1000 | Stream.concat(
|
991 |
| - Stream.of(searchRequestStats, searchRequestSlowLog), |
| 1001 | + Stream.of(searchRequestStats, searchRequestSlowLog, searchTaskRequestOperationsListener), |
992 | 1002 | pluginComponents.stream()
|
993 | 1003 | .filter(p -> p instanceof SearchRequestOperationsListener)
|
994 | 1004 | .map(p -> (SearchRequestOperationsListener) p)
|
@@ -1117,12 +1127,6 @@ protected Node(
|
1117 | 1127 | // development. Then we can deprecate Getter and Setter for IndexingPressureService in ClusterService (#478).
|
1118 | 1128 | clusterService.setIndexingPressureService(indexingPressureService);
|
1119 | 1129 |
|
1120 |
| - final TaskResourceTrackingService taskResourceTrackingService = new TaskResourceTrackingService( |
1121 |
| - settings, |
1122 |
| - clusterService.getClusterSettings(), |
1123 |
| - threadPool |
1124 |
| - ); |
1125 |
| - |
1126 | 1130 | final SearchBackpressureSettings searchBackpressureSettings = new SearchBackpressureSettings(
|
1127 | 1131 | settings,
|
1128 | 1132 | clusterService.getClusterSettings()
|
|
0 commit comments