Search in sources :

Example 1 with ThreadPool

use of org.opensearch.threadpool.ThreadPool in project OpenSearch by opensearch-project.

the class ActionModule method initRestHandlers.

public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
    List<AbstractCatAction> catActions = new ArrayList<>();
    Consumer<RestHandler> registerHandler = handler -> {
        if (handler instanceof AbstractCatAction) {
            catActions.add((AbstractCatAction) handler);
        }
        restController.registerHandler(handler);
    };
    registerHandler.accept(new RestAddVotingConfigExclusionAction());
    registerHandler.accept(new RestClearVotingConfigExclusionsAction());
    registerHandler.accept(new RestMainAction());
    registerHandler.accept(new RestNodesInfoAction(settingsFilter));
    registerHandler.accept(new RestRemoteClusterInfoAction());
    registerHandler.accept(new RestNodesStatsAction());
    registerHandler.accept(new RestNodesUsageAction());
    registerHandler.accept(new RestNodesHotThreadsAction());
    registerHandler.accept(new RestClusterAllocationExplainAction());
    registerHandler.accept(new RestClusterStatsAction());
    registerHandler.accept(new RestClusterStateAction(settingsFilter));
    registerHandler.accept(new RestClusterHealthAction());
    registerHandler.accept(new RestClusterUpdateSettingsAction());
    registerHandler.accept(new RestClusterGetSettingsAction(settings, clusterSettings, settingsFilter));
    registerHandler.accept(new RestClusterRerouteAction(settingsFilter));
    registerHandler.accept(new RestClusterSearchShardsAction());
    registerHandler.accept(new RestPendingClusterTasksAction());
    registerHandler.accept(new RestPutRepositoryAction());
    registerHandler.accept(new RestGetRepositoriesAction(settingsFilter));
    registerHandler.accept(new RestDeleteRepositoryAction());
    registerHandler.accept(new RestVerifyRepositoryAction());
    registerHandler.accept(new RestCleanupRepositoryAction());
    registerHandler.accept(new RestGetSnapshotsAction());
    registerHandler.accept(new RestCreateSnapshotAction());
    registerHandler.accept(new RestCloneSnapshotAction());
    registerHandler.accept(new RestRestoreSnapshotAction());
    registerHandler.accept(new RestDeleteSnapshotAction());
    registerHandler.accept(new RestSnapshotsStatusAction());
    registerHandler.accept(new RestGetIndicesAction());
    registerHandler.accept(new RestIndicesStatsAction());
    registerHandler.accept(new RestIndicesSegmentsAction());
    registerHandler.accept(new RestIndicesShardStoresAction());
    registerHandler.accept(new RestGetAliasesAction());
    registerHandler.accept(new RestIndexDeleteAliasesAction());
    registerHandler.accept(new RestIndexPutAliasAction());
    registerHandler.accept(new RestIndicesAliasesAction());
    registerHandler.accept(new RestCreateIndexAction());
    registerHandler.accept(new RestResizeHandler.RestShrinkIndexAction());
    registerHandler.accept(new RestResizeHandler.RestSplitIndexAction());
    registerHandler.accept(new RestResizeHandler.RestCloneIndexAction());
    registerHandler.accept(new RestRolloverIndexAction());
    registerHandler.accept(new RestDeleteIndexAction());
    registerHandler.accept(new RestCloseIndexAction());
    registerHandler.accept(new RestOpenIndexAction());
    registerHandler.accept(new RestAddIndexBlockAction());
    registerHandler.accept(new RestUpdateSettingsAction());
    registerHandler.accept(new RestGetSettingsAction());
    registerHandler.accept(new RestAnalyzeAction());
    registerHandler.accept(new RestGetIndexTemplateAction());
    registerHandler.accept(new RestPutIndexTemplateAction());
    registerHandler.accept(new RestDeleteIndexTemplateAction());
    registerHandler.accept(new RestPutComponentTemplateAction());
    registerHandler.accept(new RestGetComponentTemplateAction());
    registerHandler.accept(new RestDeleteComponentTemplateAction());
    registerHandler.accept(new RestPutComposableIndexTemplateAction());
    registerHandler.accept(new RestGetComposableIndexTemplateAction());
    registerHandler.accept(new RestDeleteComposableIndexTemplateAction());
    registerHandler.accept(new RestSimulateIndexTemplateAction());
    registerHandler.accept(new RestSimulateTemplateAction());
    registerHandler.accept(new RestPutMappingAction());
    registerHandler.accept(new RestGetMappingAction(threadPool));
    registerHandler.accept(new RestGetFieldMappingAction());
    registerHandler.accept(new RestRefreshAction());
    registerHandler.accept(new RestFlushAction());
    registerHandler.accept(new RestSyncedFlushAction());
    registerHandler.accept(new RestForceMergeAction());
    registerHandler.accept(new RestUpgradeAction());
    registerHandler.accept(new RestUpgradeStatusAction());
    registerHandler.accept(new RestClearIndicesCacheAction());
    registerHandler.accept(new RestIndexAction());
    registerHandler.accept(new CreateHandler());
    registerHandler.accept(new AutoIdHandler(nodesInCluster));
    registerHandler.accept(new RestGetAction());
    registerHandler.accept(new RestGetSourceAction());
    registerHandler.accept(new RestMultiGetAction(settings));
    registerHandler.accept(new RestDeleteAction());
    registerHandler.accept(new RestCountAction());
    registerHandler.accept(new RestTermVectorsAction());
    registerHandler.accept(new RestMultiTermVectorsAction());
    registerHandler.accept(new RestBulkAction(settings));
    registerHandler.accept(new RestUpdateAction());
    registerHandler.accept(new RestSearchAction());
    registerHandler.accept(new RestSearchScrollAction());
    registerHandler.accept(new RestClearScrollAction());
    registerHandler.accept(new RestMultiSearchAction(settings));
    registerHandler.accept(new RestValidateQueryAction());
    registerHandler.accept(new RestExplainAction());
    registerHandler.accept(new RestRecoveryAction());
    registerHandler.accept(new RestReloadSecureSettingsAction());
    // Scripts API
    registerHandler.accept(new RestGetStoredScriptAction());
    registerHandler.accept(new RestPutStoredScriptAction());
    registerHandler.accept(new RestDeleteStoredScriptAction());
    registerHandler.accept(new RestGetScriptContextAction());
    registerHandler.accept(new RestGetScriptLanguageAction());
    registerHandler.accept(new RestFieldCapabilitiesAction());
    // Tasks API
    registerHandler.accept(new RestListTasksAction(nodesInCluster));
    registerHandler.accept(new RestGetTaskAction());
    registerHandler.accept(new RestCancelTasksAction(nodesInCluster));
    // Ingest API
    registerHandler.accept(new RestPutPipelineAction());
    registerHandler.accept(new RestGetPipelineAction());
    registerHandler.accept(new RestDeletePipelineAction());
    registerHandler.accept(new RestSimulatePipelineAction());
    // Dangling indices API
    registerHandler.accept(new RestListDanglingIndicesAction());
    registerHandler.accept(new RestImportDanglingIndexAction());
    registerHandler.accept(new RestDeleteDanglingIndexAction());
    // Data Stream API
    registerHandler.accept(new RestCreateDataStreamAction());
    registerHandler.accept(new RestDeleteDataStreamAction());
    registerHandler.accept(new RestGetDataStreamsAction());
    registerHandler.accept(new RestResolveIndexAction());
    registerHandler.accept(new RestDataStreamsStatsAction());
    // CAT API
    registerHandler.accept(new RestAllocationAction());
    registerHandler.accept(new RestShardsAction());
    registerHandler.accept(new RestMasterAction());
    registerHandler.accept(new RestNodesAction());
    registerHandler.accept(new RestTasksAction(nodesInCluster));
    registerHandler.accept(new RestIndicesAction());
    registerHandler.accept(new RestSegmentsAction());
    // Fully qualified to prevent interference with rest.action.count.RestCountAction
    registerHandler.accept(new org.opensearch.rest.action.cat.RestCountAction());
    // Fully qualified to prevent interference with rest.action.indices.RestRecoveryAction
    registerHandler.accept(new RestCatRecoveryAction());
    registerHandler.accept(new RestHealthAction());
    registerHandler.accept(new org.opensearch.rest.action.cat.RestPendingClusterTasksAction());
    registerHandler.accept(new RestAliasAction());
    registerHandler.accept(new RestThreadPoolAction());
    registerHandler.accept(new RestPluginsAction());
    registerHandler.accept(new RestFielddataAction());
    registerHandler.accept(new RestNodeAttrsAction());
    registerHandler.accept(new RestRepositoriesAction());
    registerHandler.accept(new RestSnapshotAction());
    registerHandler.accept(new RestTemplatesAction());
    for (ActionPlugin plugin : actionPlugins) {
        for (RestHandler handler : plugin.getRestHandlers(settings, restController, clusterSettings, indexScopedSettings, settingsFilter, indexNameExpressionResolver, nodesInCluster)) {
            registerHandler.accept(handler);
        }
    }
    registerHandler.accept(new RestCatAction(catActions));
}
Also used : RestCloseIndexAction(org.opensearch.rest.action.admin.indices.RestCloseIndexAction) SimulatePipelineAction(org.opensearch.action.ingest.SimulatePipelineAction) RestGetPipelineAction(org.opensearch.rest.action.ingest.RestGetPipelineAction) TransportPutStoredScriptAction(org.opensearch.action.admin.cluster.storedscripts.TransportPutStoredScriptAction) TransportPutMappingAction(org.opensearch.action.admin.indices.mapping.put.TransportPutMappingAction) BulkAction(org.opensearch.action.bulk.BulkAction) RestDeletePipelineAction(org.opensearch.rest.action.ingest.RestDeletePipelineAction) RestIndicesShardStoresAction(org.opensearch.rest.action.admin.indices.RestIndicesShardStoresAction) TransportGetStoredScriptAction(org.opensearch.action.admin.cluster.storedscripts.TransportGetStoredScriptAction) ClusterStatsAction(org.opensearch.action.admin.cluster.stats.ClusterStatsAction) TransportFieldCapabilitiesIndexAction(org.opensearch.action.fieldcaps.TransportFieldCapabilitiesIndexAction) TransportMultiSearchAction(org.opensearch.action.search.TransportMultiSearchAction) IndicesAliasesAction(org.opensearch.action.admin.indices.alias.IndicesAliasesAction) MultiGetAction(org.opensearch.action.get.MultiGetAction) ClearVotingConfigExclusionsAction(org.opensearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsAction) TransportListDanglingIndicesAction(org.opensearch.action.admin.indices.dangling.list.TransportListDanglingIndicesAction) GetMappingsAction(org.opensearch.action.admin.indices.mapping.get.GetMappingsAction) RestThreadPoolAction(org.opensearch.rest.action.cat.RestThreadPoolAction) RestFieldCapabilitiesAction(org.opensearch.rest.action.RestFieldCapabilitiesAction) GetIndexAction(org.opensearch.action.admin.indices.get.GetIndexAction) TransportClusterRerouteAction(org.opensearch.action.admin.cluster.reroute.TransportClusterRerouteAction) AliasesExistAction(org.opensearch.action.admin.indices.alias.exists.AliasesExistAction) RestDeleteIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestDeleteIndexTemplateAction) IndexAction(org.opensearch.action.index.IndexAction) RestCreateDataStreamAction(org.opensearch.rest.action.admin.indices.RestCreateDataStreamAction) RestPendingClusterTasksAction(org.opensearch.rest.action.admin.cluster.RestPendingClusterTasksAction) RestDeleteIndexAction(org.opensearch.rest.action.admin.indices.RestDeleteIndexAction) RestHeaderDefinition(org.opensearch.rest.RestHeaderDefinition) TransportSearchScrollAction(org.opensearch.action.search.TransportSearchScrollAction) RestAddVotingConfigExclusionAction(org.opensearch.rest.action.admin.cluster.RestAddVotingConfigExclusionAction) TransportUpgradeSettingsAction(org.opensearch.action.admin.indices.upgrade.post.TransportUpgradeSettingsAction) TransportMultiGetAction(org.opensearch.action.get.TransportMultiGetAction) TransportRolloverAction(org.opensearch.action.admin.indices.rollover.TransportRolloverAction) TransportLivenessAction(org.opensearch.action.admin.cluster.node.liveness.TransportLivenessAction) MultiTermVectorsAction(org.opensearch.action.termvectors.MultiTermVectorsAction) TransportGetIndexTemplatesAction(org.opensearch.action.admin.indices.template.get.TransportGetIndexTemplatesAction) Supplier(java.util.function.Supplier) TransportAddIndexBlockAction(org.opensearch.action.admin.indices.readonly.TransportAddIndexBlockAction) RestDeleteComponentTemplateAction(org.opensearch.rest.action.admin.indices.RestDeleteComponentTemplateAction) CloneSnapshotAction(org.opensearch.action.admin.cluster.snapshots.clone.CloneSnapshotAction) RestIndexAction(org.opensearch.rest.action.document.RestIndexAction) PutPipelineAction(org.opensearch.action.ingest.PutPipelineAction) TransportNodesHotThreadsAction(org.opensearch.action.admin.cluster.node.hotthreads.TransportNodesHotThreadsAction) SimulateIndexTemplateAction(org.opensearch.action.admin.indices.template.post.SimulateIndexTemplateAction) TransportSnapshotsStatusAction(org.opensearch.action.admin.cluster.snapshots.status.TransportSnapshotsStatusAction) RestClusterUpdateSettingsAction(org.opensearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction) RestRestoreSnapshotAction(org.opensearch.rest.action.admin.cluster.RestRestoreSnapshotAction) TransportAnalyzeAction(org.opensearch.action.admin.indices.analyze.TransportAnalyzeAction) RestNodeAttrsAction(org.opensearch.rest.action.cat.RestNodeAttrsAction) ClusterAllocationExplainAction(org.opensearch.action.admin.cluster.allocation.ClusterAllocationExplainAction) TransportSimulateIndexTemplateAction(org.opensearch.action.admin.indices.template.post.TransportSimulateIndexTemplateAction) RestGetIndicesAction(org.opensearch.rest.action.admin.indices.RestGetIndicesAction) DestructiveOperations(org.opensearch.action.support.DestructiveOperations) RestSearchScrollAction(org.opensearch.rest.action.search.RestSearchScrollAction) RestReloadSecureSettingsAction(org.opensearch.rest.action.admin.cluster.RestReloadSecureSettingsAction) RestPutComposableIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestPutComposableIndexTemplateAction) RestGetComponentTemplateAction(org.opensearch.rest.action.admin.indices.RestGetComponentTemplateAction) RefreshAction(org.opensearch.action.admin.indices.refresh.RefreshAction) TransportDeleteRepositoryAction(org.opensearch.action.admin.cluster.repositories.delete.TransportDeleteRepositoryAction) ClusterSearchShardsAction(org.opensearch.action.admin.cluster.shards.ClusterSearchShardsAction) RestClusterRerouteAction(org.opensearch.rest.action.admin.cluster.RestClusterRerouteAction) TransportAutoPutMappingAction(org.opensearch.action.admin.indices.mapping.put.TransportAutoPutMappingAction) ClusterStateAction(org.opensearch.action.admin.cluster.state.ClusterStateAction) CreateSnapshotAction(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotAction) Collectors(java.util.stream.Collectors) GetFieldMappingsAction(org.opensearch.action.admin.indices.mapping.get.GetFieldMappingsAction) TransportPutIndexTemplateAction(org.opensearch.action.admin.indices.template.put.TransportPutIndexTemplateAction) TransportSimulateTemplateAction(org.opensearch.action.admin.indices.template.post.TransportSimulateTemplateAction) RestRefreshAction(org.opensearch.rest.action.admin.indices.RestRefreshAction) RestGetSourceAction(org.opensearch.rest.action.document.RestGetSourceAction) RestCountAction(org.opensearch.rest.action.search.RestCountAction) CompletionPersistentTaskAction(org.opensearch.persistent.CompletionPersistentTaskAction) RestHealthAction(org.opensearch.rest.action.cat.RestHealthAction) RestHandler(org.opensearch.rest.RestHandler) GetSettingsAction(org.opensearch.action.admin.indices.settings.get.GetSettingsAction) DeleteIndexAction(org.opensearch.action.admin.indices.delete.DeleteIndexAction) TransportUpgradeAction(org.opensearch.action.admin.indices.upgrade.post.TransportUpgradeAction) RestClusterStatsAction(org.opensearch.rest.action.admin.cluster.RestClusterStatsAction) TransportShardBulkAction(org.opensearch.action.bulk.TransportShardBulkAction) ClearScrollAction(org.opensearch.action.search.ClearScrollAction) RestMultiGetAction(org.opensearch.rest.action.document.RestMultiGetAction) RestBulkAction(org.opensearch.rest.action.document.RestBulkAction) SettingsFilter(org.opensearch.common.settings.SettingsFilter) RestResizeHandler(org.opensearch.rest.action.admin.indices.RestResizeHandler) RestAnalyzeAction(org.opensearch.rest.action.admin.indices.RestAnalyzeAction) AutoIdHandler(org.opensearch.rest.action.document.RestIndexAction.AutoIdHandler) ClearIndicesCacheAction(org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheAction) TransportFieldCapabilitiesAction(org.opensearch.action.fieldcaps.TransportFieldCapabilitiesAction) RestClusterStateAction(org.opensearch.rest.action.admin.cluster.RestClusterStateAction) GetScriptLanguageAction(org.opensearch.action.admin.cluster.storedscripts.GetScriptLanguageAction) TransportIndicesExistsAction(org.opensearch.action.admin.indices.exists.indices.TransportIndicesExistsAction) TransportFlushAction(org.opensearch.action.admin.indices.flush.TransportFlushAction) TransportNodesReloadSecureSettingsAction(org.opensearch.action.admin.cluster.node.reload.TransportNodesReloadSecureSettingsAction) GetAction(org.opensearch.action.get.GetAction) Consumer(java.util.function.Consumer) IndicesAliasesRequest(org.opensearch.action.admin.indices.alias.IndicesAliasesRequest) TransportOpenIndexAction(org.opensearch.action.admin.indices.open.TransportOpenIndexAction) TransportClearIndicesCacheAction(org.opensearch.action.admin.indices.cache.clear.TransportClearIndicesCacheAction) UpdateAction(org.opensearch.action.update.UpdateAction) GetComposableIndexTemplateAction(org.opensearch.action.admin.indices.template.get.GetComposableIndexTemplateAction) LogManager(org.apache.logging.log4j.LogManager) RemovePersistentTaskAction(org.opensearch.persistent.RemovePersistentTaskAction) RestDeleteAction(org.opensearch.rest.action.document.RestDeleteAction) ActionPlugin(org.opensearch.plugins.ActionPlugin) TransportGetScriptLanguageAction(org.opensearch.action.admin.cluster.storedscripts.TransportGetScriptLanguageAction) TransportClusterSearchShardsAction(org.opensearch.action.admin.cluster.shards.TransportClusterSearchShardsAction) ClusterRerouteAction(org.opensearch.action.admin.cluster.reroute.ClusterRerouteAction) DeleteComponentTemplateAction(org.opensearch.action.admin.indices.template.delete.DeleteComponentTemplateAction) RestFlushAction(org.opensearch.rest.action.admin.indices.RestFlushAction) CleanupRepositoryAction(org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryAction) RestDeleteRepositoryAction(org.opensearch.rest.action.admin.cluster.RestDeleteRepositoryAction) TransportClusterHealthAction(org.opensearch.action.admin.cluster.health.TransportClusterHealthAction) RestOpenIndexAction(org.opensearch.rest.action.admin.indices.RestOpenIndexAction) TransportGetAliasesAction(org.opensearch.action.admin.indices.alias.get.TransportGetAliasesAction) TransportNodesInfoAction(org.opensearch.action.admin.cluster.node.info.TransportNodesInfoAction) TransportTermVectorsAction(org.opensearch.action.termvectors.TransportTermVectorsAction) MapBinder(org.opensearch.common.inject.multibindings.MapBinder) StartPersistentTaskAction(org.opensearch.persistent.StartPersistentTaskAction) RestUpgradeStatusAction(org.opensearch.rest.action.admin.indices.RestUpgradeStatusAction) TransportPendingClusterTasksAction(org.opensearch.action.admin.cluster.tasks.TransportPendingClusterTasksAction) TransportDeleteStoredScriptAction(org.opensearch.action.admin.cluster.storedscripts.TransportDeleteStoredScriptAction) TransportShardMultiTermsVectorAction(org.opensearch.action.termvectors.TransportShardMultiTermsVectorAction) TransportDeleteComponentTemplateAction(org.opensearch.action.admin.indices.template.delete.TransportDeleteComponentTemplateAction) ActionFilters(org.opensearch.action.support.ActionFilters) TypesExistsAction(org.opensearch.action.admin.indices.exists.types.TypesExistsAction) RestMultiSearchAction(org.opensearch.rest.action.search.RestMultiSearchAction) RestDeleteDanglingIndexAction(org.opensearch.rest.action.admin.cluster.dangling.RestDeleteDanglingIndexAction) RestAllocationAction(org.opensearch.rest.action.cat.RestAllocationAction) DeleteIndexTemplateAction(org.opensearch.action.admin.indices.template.delete.DeleteIndexTemplateAction) PutComposableIndexTemplateAction(org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction) TransportDeleteAction(org.opensearch.action.delete.TransportDeleteAction) UpgradeAction(org.opensearch.action.admin.indices.upgrade.post.UpgradeAction) TransportDeleteSnapshotAction(org.opensearch.action.admin.cluster.snapshots.delete.TransportDeleteSnapshotAction) RestPutRepositoryAction(org.opensearch.rest.action.admin.cluster.RestPutRepositoryAction) ArrayList(java.util.ArrayList) TransportClusterStateAction(org.opensearch.action.admin.cluster.state.TransportClusterStateAction) TransportGetSnapshotsAction(org.opensearch.action.admin.cluster.snapshots.get.TransportGetSnapshotsAction) FindDanglingIndexAction(org.opensearch.action.admin.indices.dangling.find.FindDanglingIndexAction) RestClearVotingConfigExclusionsAction(org.opensearch.rest.action.admin.cluster.RestClearVotingConfigExclusionsAction) GetRepositoriesAction(org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesAction) RestTemplatesAction(org.opensearch.rest.action.cat.RestTemplatesAction) ListTasksAction(org.opensearch.action.admin.cluster.node.tasks.list.ListTasksAction) TransportIndicesShardStoresAction(org.opensearch.action.admin.indices.shards.TransportIndicesShardStoresAction) RestController(org.opensearch.rest.RestController) RestGetStoredScriptAction(org.opensearch.rest.action.admin.cluster.RestGetStoredScriptAction) NodesStatsAction(org.opensearch.action.admin.cluster.node.stats.NodesStatsAction) RestPutMappingAction(org.opensearch.rest.action.admin.indices.RestPutMappingAction) RestGetAliasesAction(org.opensearch.rest.action.admin.indices.RestGetAliasesAction) SystemIndices(org.opensearch.indices.SystemIndices) RestClusterSearchShardsAction(org.opensearch.rest.action.admin.cluster.RestClusterSearchShardsAction) RestGetScriptContextAction(org.opensearch.rest.action.admin.cluster.RestGetScriptContextAction) RestSimulateTemplateAction(org.opensearch.rest.action.admin.indices.RestSimulateTemplateAction) NodesUsageAction(org.opensearch.action.admin.cluster.node.usage.NodesUsageAction) NodesReloadSecureSettingsAction(org.opensearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsAction) RestIndicesAliasesAction(org.opensearch.rest.action.admin.indices.RestIndicesAliasesAction) TransportRefreshAction(org.opensearch.action.admin.indices.refresh.TransportRefreshAction) RestMainAction(org.opensearch.rest.action.RestMainAction) TransportUpdateSettingsAction(org.opensearch.action.admin.indices.settings.put.TransportUpdateSettingsAction) RestGetTaskAction(org.opensearch.rest.action.admin.cluster.RestGetTaskAction) DeletePipelineAction(org.opensearch.action.ingest.DeletePipelineAction) TransportUpdateAction(org.opensearch.action.update.TransportUpdateAction) TransportSearchAction(org.opensearch.action.search.TransportSearchAction) DeleteComposableIndexTemplateAction(org.opensearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction) TransportPutComposableIndexTemplateAction(org.opensearch.action.admin.indices.template.put.TransportPutComposableIndexTemplateAction) IndicesSegmentsAction(org.opensearch.action.admin.indices.segments.IndicesSegmentsAction) AutoCreateAction(org.opensearch.action.admin.indices.create.AutoCreateAction) RestIndexPutAliasAction(org.opensearch.rest.action.admin.indices.RestIndexPutAliasAction) DeleteStoredScriptAction(org.opensearch.action.admin.cluster.storedscripts.DeleteStoredScriptAction) RestGetMappingAction(org.opensearch.rest.action.admin.indices.RestGetMappingAction) RestDeleteDataStreamAction(org.opensearch.rest.action.admin.indices.RestDeleteDataStreamAction) RestCloneSnapshotAction(org.opensearch.rest.action.admin.cluster.RestCloneSnapshotAction) RestGetAction(org.opensearch.rest.action.document.RestGetAction) ClusterHealthAction(org.opensearch.action.admin.cluster.health.ClusterHealthAction) CreateIndexAction(org.opensearch.action.admin.indices.create.CreateIndexAction) TransportDeleteComposableIndexTemplateAction(org.opensearch.action.admin.indices.template.delete.TransportDeleteComposableIndexTemplateAction) List(java.util.List) RestDataStreamsStatsAction(org.opensearch.rest.action.admin.indices.RestDataStreamsStatsAction) TransportAliasesExistAction(org.opensearch.action.admin.indices.alias.exists.TransportAliasesExistAction) RestNodesStatsAction(org.opensearch.rest.action.admin.cluster.RestNodesStatsAction) RemoteInfoAction(org.opensearch.action.admin.cluster.remote.RemoteInfoAction) RestTasksAction(org.opensearch.rest.action.cat.RestTasksAction) RestGetRepositoriesAction(org.opensearch.rest.action.admin.cluster.RestGetRepositoriesAction) TransportVerifyRepositoryAction(org.opensearch.action.admin.cluster.repositories.verify.TransportVerifyRepositoryAction) RestRolloverIndexAction(org.opensearch.rest.action.admin.indices.RestRolloverIndexAction) RestGetScriptLanguageAction(org.opensearch.rest.action.admin.cluster.RestGetScriptLanguageAction) ValidateQueryAction(org.opensearch.action.admin.indices.validate.query.ValidateQueryAction) TransportClusterStatsAction(org.opensearch.action.admin.cluster.stats.TransportClusterStatsAction) AddVotingConfigExclusionsAction(org.opensearch.action.admin.cluster.configuration.AddVotingConfigExclusionsAction) RestDeleteSnapshotAction(org.opensearch.rest.action.admin.cluster.RestDeleteSnapshotAction) ClusterSettings(org.opensearch.common.settings.ClusterSettings) RestClearIndicesCacheAction(org.opensearch.rest.action.admin.indices.RestClearIndicesCacheAction) ListDanglingIndicesAction(org.opensearch.action.admin.indices.dangling.list.ListDanglingIndicesAction) MainAction(org.opensearch.action.main.MainAction) DeleteRepositoryAction(org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryAction) RestSimulateIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestSimulateIndexTemplateAction) ResolveIndexAction(org.opensearch.action.admin.indices.resolve.ResolveIndexAction) TransportMainAction(org.opensearch.action.main.TransportMainAction) RestRemoteClusterInfoAction(org.opensearch.rest.action.admin.cluster.RestRemoteClusterInfoAction) GetSnapshotsAction(org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsAction) TransportPutRepositoryAction(org.opensearch.action.admin.cluster.repositories.put.TransportPutRepositoryAction) RestMultiTermVectorsAction(org.opensearch.rest.action.document.RestMultiTermVectorsAction) NodesInfoAction(org.opensearch.action.admin.cluster.node.info.NodesInfoAction) RestCatRecoveryAction(org.opensearch.rest.action.cat.RestCatRecoveryAction) Map(java.util.Map) PutMappingAction(org.opensearch.action.admin.indices.mapping.put.PutMappingAction) RestExplainAction(org.opensearch.rest.action.search.RestExplainAction) TransportExplainAction(org.opensearch.action.explain.TransportExplainAction) NodeClient(org.opensearch.client.node.NodeClient) RestClusterHealthAction(org.opensearch.rest.action.admin.cluster.RestClusterHealthAction) RestMasterAction(org.opensearch.rest.action.cat.RestMasterAction) RestShardsAction(org.opensearch.rest.action.cat.RestShardsAction) TransportListTasksAction(org.opensearch.action.admin.cluster.node.tasks.list.TransportListTasksAction) TransportClusterUpdateSettingsAction(org.opensearch.action.admin.cluster.settings.TransportClusterUpdateSettingsAction) Logger(org.apache.logging.log4j.Logger) Stream(java.util.stream.Stream) RestSegmentsAction(org.opensearch.rest.action.cat.RestSegmentsAction) VerifyRepositoryAction(org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryAction) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) PendingClusterTasksAction(org.opensearch.action.admin.cluster.tasks.PendingClusterTasksAction) SearchAction(org.opensearch.action.search.SearchAction) RestNodesAction(org.opensearch.rest.action.cat.RestNodesAction) UpdateSettingsAction(org.opensearch.action.admin.indices.settings.put.UpdateSettingsAction) RestSnapshotAction(org.opensearch.rest.action.cat.RestSnapshotAction) TransportGetComposableIndexTemplateAction(org.opensearch.action.admin.indices.template.get.TransportGetComposableIndexTemplateAction) ThreadPool(org.opensearch.threadpool.ThreadPool) TransportIndexAction(org.opensearch.action.index.TransportIndexAction) PutPipelineTransportAction(org.opensearch.action.ingest.PutPipelineTransportAction) RestoreSnapshotAction(org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotAction) GetPipelineTransportAction(org.opensearch.action.ingest.GetPipelineTransportAction) TransportGetFieldMappingsIndexAction(org.opensearch.action.admin.indices.mapping.get.TransportGetFieldMappingsIndexAction) RestRecoveryAction(org.opensearch.rest.action.admin.indices.RestRecoveryAction) TransportRemoteInfoAction(org.opensearch.action.admin.cluster.remote.TransportRemoteInfoAction) RestDeleteStoredScriptAction(org.opensearch.rest.action.admin.cluster.RestDeleteStoredScriptAction) TermVectorsAction(org.opensearch.action.termvectors.TermVectorsAction) DeleteDanglingIndexAction(org.opensearch.action.admin.indices.dangling.delete.DeleteDanglingIndexAction) GetAliasesAction(org.opensearch.action.admin.indices.alias.get.GetAliasesAction) FlushAction(org.opensearch.action.admin.indices.flush.FlushAction) TransportGetSettingsAction(org.opensearch.action.admin.indices.settings.get.TransportGetSettingsAction) TransportIndicesSegmentsAction(org.opensearch.action.admin.indices.segments.TransportIndicesSegmentsAction) UpgradeSettingsAction(org.opensearch.action.admin.indices.upgrade.post.UpgradeSettingsAction) NamedRegistry(org.opensearch.common.NamedRegistry) IndicesExistsAction(org.opensearch.action.admin.indices.exists.indices.IndicesExistsAction) TransportResizeAction(org.opensearch.action.admin.indices.shrink.TransportResizeAction) DeleteSnapshotAction(org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotAction) ImportDanglingIndexAction(org.opensearch.action.admin.indices.dangling.import_index.ImportDanglingIndexAction) RestGetSettingsAction(org.opensearch.rest.action.admin.indices.RestGetSettingsAction) RestImportDanglingIndexAction(org.opensearch.rest.action.admin.cluster.dangling.RestImportDanglingIndexAction) IndicesShardStoresAction(org.opensearch.action.admin.indices.shards.IndicesShardStoresAction) RestGetFieldMappingAction(org.opensearch.rest.action.admin.indices.RestGetFieldMappingAction) RestValidateQueryAction(org.opensearch.rest.action.admin.indices.RestValidateQueryAction) PutStoredScriptAction(org.opensearch.action.admin.cluster.storedscripts.PutStoredScriptAction) TransportDeleteDanglingIndexAction(org.opensearch.action.admin.indices.dangling.delete.TransportDeleteDanglingIndexAction) PutMappingRequest(org.opensearch.action.admin.indices.mapping.put.PutMappingRequest) CancelTasksAction(org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksAction) AutoPutMappingAction(org.opensearch.action.admin.indices.mapping.put.AutoPutMappingAction) TransportCancelTasksAction(org.opensearch.action.admin.cluster.node.tasks.cancel.TransportCancelTasksAction) Task(org.opensearch.tasks.Task) RestGetSnapshotsAction(org.opensearch.rest.action.admin.cluster.RestGetSnapshotsAction) TypeLiteral(org.opensearch.common.inject.TypeLiteral) RestPluginsAction(org.opensearch.rest.action.cat.RestPluginsAction) TransportValidateQueryAction(org.opensearch.action.admin.indices.validate.query.TransportValidateQueryAction) RestResolveIndexAction(org.opensearch.rest.action.admin.indices.RestResolveIndexAction) CreateHandler(org.opensearch.rest.action.document.RestIndexAction.CreateHandler) UpgradeStatusAction(org.opensearch.action.admin.indices.upgrade.get.UpgradeStatusAction) UsageService(org.opensearch.usage.UsageService) TransportClearScrollAction(org.opensearch.action.search.TransportClearScrollAction) TransportCloseIndexAction(org.opensearch.action.admin.indices.close.TransportCloseIndexAction) TransportUpgradeStatusAction(org.opensearch.action.admin.indices.upgrade.get.TransportUpgradeStatusAction) RestCancelTasksAction(org.opensearch.rest.action.admin.cluster.RestCancelTasksAction) TransportGetRepositoriesAction(org.opensearch.action.admin.cluster.repositories.get.TransportGetRepositoriesAction) AnalyzeAction(org.opensearch.action.admin.indices.analyze.AnalyzeAction) TransportCreateIndexAction(org.opensearch.action.admin.indices.create.TransportCreateIndexAction) CloseIndexAction(org.opensearch.action.admin.indices.close.CloseIndexAction) RecoveryAction(org.opensearch.action.admin.indices.recovery.RecoveryAction) PutRepositoryAction(org.opensearch.action.admin.cluster.repositories.put.PutRepositoryAction) TransportGetIndexAction(org.opensearch.action.admin.indices.get.TransportGetIndexAction) CreateDataStreamAction(org.opensearch.action.admin.indices.datastream.CreateDataStreamAction) RestVerifyRepositoryAction(org.opensearch.rest.action.admin.cluster.RestVerifyRepositoryAction) GetDataStreamAction(org.opensearch.action.admin.indices.datastream.GetDataStreamAction) RestIndicesSegmentsAction(org.opensearch.rest.action.admin.indices.RestIndicesSegmentsAction) TransportGetTaskAction(org.opensearch.action.admin.cluster.node.tasks.get.TransportGetTaskAction) DataStreamsStatsAction(org.opensearch.action.admin.indices.datastream.DataStreamsStatsAction) TransportPutComponentTemplateAction(org.opensearch.action.admin.indices.template.put.TransportPutComponentTemplateAction) FieldCapabilitiesAction(org.opensearch.action.fieldcaps.FieldCapabilitiesAction) RestNodesInfoAction(org.opensearch.rest.action.admin.cluster.RestNodesInfoAction) TransportGetFieldMappingsAction(org.opensearch.action.admin.indices.mapping.get.TransportGetFieldMappingsAction) RestUpgradeAction(org.opensearch.rest.action.admin.indices.RestUpgradeAction) TransportGetMappingsAction(org.opensearch.action.admin.indices.mapping.get.TransportGetMappingsAction) IndexScopedSettings(org.opensearch.common.settings.IndexScopedSettings) RestTermVectorsAction(org.opensearch.rest.action.document.RestTermVectorsAction) UnaryOperator(java.util.function.UnaryOperator) RestCreateSnapshotAction(org.opensearch.rest.action.admin.cluster.RestCreateSnapshotAction) RestCreateIndexAction(org.opensearch.rest.action.admin.indices.RestCreateIndexAction) RestDeleteComposableIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestDeleteComposableIndexTemplateAction) RestIndicesStatsAction(org.opensearch.rest.action.admin.indices.RestIndicesStatsAction) RestPutComponentTemplateAction(org.opensearch.rest.action.admin.indices.RestPutComponentTemplateAction) TransportClearVotingConfigExclusionsAction(org.opensearch.action.admin.cluster.configuration.TransportClearVotingConfigExclusionsAction) TransportCreateSnapshotAction(org.opensearch.action.admin.cluster.snapshots.create.TransportCreateSnapshotAction) TransportAddVotingConfigExclusionsAction(org.opensearch.action.admin.cluster.configuration.TransportAddVotingConfigExclusionsAction) NodesHotThreadsAction(org.opensearch.action.admin.cluster.node.hotthreads.NodesHotThreadsAction) RestForceMergeAction(org.opensearch.rest.action.admin.indices.RestForceMergeAction) RestCleanupRepositoryAction(org.opensearch.rest.action.admin.cluster.RestCleanupRepositoryAction) RestPutPipelineAction(org.opensearch.rest.action.ingest.RestPutPipelineAction) TransportGetScriptContextAction(org.opensearch.action.admin.cluster.storedscripts.TransportGetScriptContextAction) AbstractCatAction(org.opensearch.rest.action.cat.AbstractCatAction) Set(java.util.Set) AddIndexBlockAction(org.opensearch.action.admin.indices.readonly.AddIndexBlockAction) Settings(org.opensearch.common.settings.Settings) RestGetComposableIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestGetComposableIndexTemplateAction) RestSimulatePipelineAction(org.opensearch.rest.action.ingest.RestSimulatePipelineAction) OpenIndexAction(org.opensearch.action.admin.indices.open.OpenIndexAction) RetentionLeaseActions(org.opensearch.index.seqno.RetentionLeaseActions) TransportNodesUsageAction(org.opensearch.action.admin.cluster.node.usage.TransportNodesUsageAction) TransportForceMergeAction(org.opensearch.action.admin.indices.forcemerge.TransportForceMergeAction) RestIndicesAction(org.opensearch.rest.action.cat.RestIndicesAction) RestRepositoriesAction(org.opensearch.rest.action.cat.RestRepositoriesAction) TransportCloneSnapshotAction(org.opensearch.action.admin.cluster.snapshots.clone.TransportCloneSnapshotAction) SearchScrollAction(org.opensearch.action.search.SearchScrollAction) RestCatAction(org.opensearch.rest.action.cat.RestCatAction) RestPutIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestPutIndexTemplateAction) GetComponentTemplateAction(org.opensearch.action.admin.indices.template.get.GetComponentTemplateAction) TransportShardMultiGetAction(org.opensearch.action.get.TransportShardMultiGetAction) PutComponentTemplateAction(org.opensearch.action.admin.indices.template.put.PutComponentTemplateAction) GetPipelineAction(org.opensearch.action.ingest.GetPipelineAction) DeleteDataStreamAction(org.opensearch.action.admin.indices.datastream.DeleteDataStreamAction) RestSearchAction(org.opensearch.rest.action.search.RestSearchAction) AbstractModule(org.opensearch.common.inject.AbstractModule) TransportClusterAllocationExplainAction(org.opensearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction) RestPutStoredScriptAction(org.opensearch.rest.action.admin.cluster.RestPutStoredScriptAction) TransportFindDanglingIndexAction(org.opensearch.action.admin.indices.dangling.find.TransportFindDanglingIndexAction) UpdatePersistentTaskStatusAction(org.opensearch.persistent.UpdatePersistentTaskStatusAction) DeleteAction(org.opensearch.action.delete.DeleteAction) RestListTasksAction(org.opensearch.rest.action.admin.cluster.RestListTasksAction) TransportTypesExistsAction(org.opensearch.action.admin.indices.exists.types.TransportTypesExistsAction) MultiSearchAction(org.opensearch.action.search.MultiSearchAction) RestSyncedFlushAction(org.opensearch.rest.action.admin.indices.RestSyncedFlushAction) RestNodesUsageAction(org.opensearch.rest.action.admin.cluster.RestNodesUsageAction) TransportRestoreSnapshotAction(org.opensearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction) RestFielddataAction(org.opensearch.rest.action.cat.RestFielddataAction) RestSnapshotsStatusAction(org.opensearch.rest.action.admin.cluster.RestSnapshotsStatusAction) TransportIndicesStatsAction(org.opensearch.action.admin.indices.stats.TransportIndicesStatsAction) TransportCleanupRepositoryAction(org.opensearch.action.admin.cluster.repositories.cleanup.TransportCleanupRepositoryAction) TransportNodesStatsAction(org.opensearch.action.admin.cluster.node.stats.TransportNodesStatsAction) GetStoredScriptAction(org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptAction) ResizeAction(org.opensearch.action.admin.indices.shrink.ResizeAction) RestNodesHotThreadsAction(org.opensearch.rest.action.admin.cluster.RestNodesHotThreadsAction) RestUpdateAction(org.opensearch.rest.action.document.RestUpdateAction) RestIndexDeleteAliasesAction(org.opensearch.rest.action.admin.indices.RestIndexDeleteAliasesAction) TransportAction(org.opensearch.action.support.TransportAction) RestClusterGetSettingsAction(org.opensearch.rest.action.admin.cluster.RestClusterGetSettingsAction) IndicesStatsAction(org.opensearch.action.admin.indices.stats.IndicesStatsAction) TransportGetComponentTemplateAction(org.opensearch.action.admin.indices.template.get.TransportGetComponentTemplateAction) TransportBulkAction(org.opensearch.action.bulk.TransportBulkAction) TransportGetAction(org.opensearch.action.get.TransportGetAction) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) SnapshotsStatusAction(org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusAction) ForceMergeAction(org.opensearch.action.admin.indices.forcemerge.ForceMergeAction) GetIndexTemplatesAction(org.opensearch.action.admin.indices.template.get.GetIndexTemplatesAction) RestListDanglingIndicesAction(org.opensearch.rest.action.admin.cluster.dangling.RestListDanglingIndicesAction) RestAliasAction(org.opensearch.rest.action.cat.RestAliasAction) RestClusterAllocationExplainAction(org.opensearch.rest.action.admin.cluster.RestClusterAllocationExplainAction) ExplainAction(org.opensearch.action.explain.ExplainAction) AutoCreateIndex(org.opensearch.action.support.AutoCreateIndex) RestGetIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestGetIndexTemplateAction) ActionHandler(org.opensearch.plugins.ActionPlugin.ActionHandler) PutIndexTemplateAction(org.opensearch.action.admin.indices.template.put.PutIndexTemplateAction) TransportMultiTermVectorsAction(org.opensearch.action.termvectors.TransportMultiTermVectorsAction) DeletePipelineTransportAction(org.opensearch.action.ingest.DeletePipelineTransportAction) GetScriptContextAction(org.opensearch.action.admin.cluster.storedscripts.GetScriptContextAction) RestGetDataStreamsAction(org.opensearch.rest.action.admin.indices.RestGetDataStreamsAction) TransportDeleteIndexAction(org.opensearch.action.admin.indices.delete.TransportDeleteIndexAction) ClusterUpdateSettingsAction(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsAction) RestUpdateSettingsAction(org.opensearch.rest.action.admin.indices.RestUpdateSettingsAction) GetTaskAction(org.opensearch.action.admin.cluster.node.tasks.get.GetTaskAction) TransportDeleteIndexTemplateAction(org.opensearch.action.admin.indices.template.delete.TransportDeleteIndexTemplateAction) TransportImportDanglingIndexAction(org.opensearch.action.admin.indices.dangling.import_index.TransportImportDanglingIndexAction) RestClearScrollAction(org.opensearch.rest.action.search.RestClearScrollAction) SimulateTemplateAction(org.opensearch.action.admin.indices.template.post.SimulateTemplateAction) CircuitBreakerService(org.opensearch.indices.breaker.CircuitBreakerService) TransportRecoveryAction(org.opensearch.action.admin.indices.recovery.TransportRecoveryAction) RolloverAction(org.opensearch.action.admin.indices.rollover.RolloverAction) RestAddIndexBlockAction(org.opensearch.rest.action.admin.indices.RestAddIndexBlockAction) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) TransportIndicesAliasesAction(org.opensearch.action.admin.indices.alias.TransportIndicesAliasesAction) Collections(java.util.Collections) SimulatePipelineTransportAction(org.opensearch.action.ingest.SimulatePipelineTransportAction) AbstractCatAction(org.opensearch.rest.action.cat.AbstractCatAction) RestIndicesAliasesAction(org.opensearch.rest.action.admin.indices.RestIndicesAliasesAction) RestGetMappingAction(org.opensearch.rest.action.admin.indices.RestGetMappingAction) ArrayList(java.util.ArrayList) RestExplainAction(org.opensearch.rest.action.search.RestExplainAction) RestReloadSecureSettingsAction(org.opensearch.rest.action.admin.cluster.RestReloadSecureSettingsAction) ActionPlugin(org.opensearch.plugins.ActionPlugin) RestDeletePipelineAction(org.opensearch.rest.action.ingest.RestDeletePipelineAction) RestTasksAction(org.opensearch.rest.action.cat.RestTasksAction) RestGetPipelineAction(org.opensearch.rest.action.ingest.RestGetPipelineAction) RestGetScriptContextAction(org.opensearch.rest.action.admin.cluster.RestGetScriptContextAction) RestGetStoredScriptAction(org.opensearch.rest.action.admin.cluster.RestGetStoredScriptAction) RestUpdateAction(org.opensearch.rest.action.document.RestUpdateAction) RestVerifyRepositoryAction(org.opensearch.rest.action.admin.cluster.RestVerifyRepositoryAction) RestGetComponentTemplateAction(org.opensearch.rest.action.admin.indices.RestGetComponentTemplateAction) RestMultiSearchAction(org.opensearch.rest.action.search.RestMultiSearchAction) RestMasterAction(org.opensearch.rest.action.cat.RestMasterAction) RestClearIndicesCacheAction(org.opensearch.rest.action.admin.indices.RestClearIndicesCacheAction) RestGetComposableIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestGetComposableIndexTemplateAction) RestSimulateIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestSimulateIndexTemplateAction) RestDataStreamsStatsAction(org.opensearch.rest.action.admin.indices.RestDataStreamsStatsAction) RestAllocationAction(org.opensearch.rest.action.cat.RestAllocationAction) RestCatAction(org.opensearch.rest.action.cat.RestCatAction) RestIndexPutAliasAction(org.opensearch.rest.action.admin.indices.RestIndexPutAliasAction) RestPutIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestPutIndexTemplateAction) RestClearScrollAction(org.opensearch.rest.action.search.RestClearScrollAction) RestHandler(org.opensearch.rest.RestHandler) RestRestoreSnapshotAction(org.opensearch.rest.action.admin.cluster.RestRestoreSnapshotAction) RestPutPipelineAction(org.opensearch.rest.action.ingest.RestPutPipelineAction) RestPutMappingAction(org.opensearch.rest.action.admin.indices.RestPutMappingAction) RestRolloverIndexAction(org.opensearch.rest.action.admin.indices.RestRolloverIndexAction) RestSearchScrollAction(org.opensearch.rest.action.search.RestSearchScrollAction) RestImportDanglingIndexAction(org.opensearch.rest.action.admin.cluster.dangling.RestImportDanglingIndexAction) RestDeleteDanglingIndexAction(org.opensearch.rest.action.admin.cluster.dangling.RestDeleteDanglingIndexAction) RestPendingClusterTasksAction(org.opensearch.rest.action.admin.cluster.RestPendingClusterTasksAction) RestDeleteDataStreamAction(org.opensearch.rest.action.admin.indices.RestDeleteDataStreamAction) RestPutRepositoryAction(org.opensearch.rest.action.admin.cluster.RestPutRepositoryAction) RestDeleteIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestDeleteIndexTemplateAction) AutoIdHandler(org.opensearch.rest.action.document.RestIndexAction.AutoIdHandler) RestDeleteRepositoryAction(org.opensearch.rest.action.admin.cluster.RestDeleteRepositoryAction) RestOpenIndexAction(org.opensearch.rest.action.admin.indices.RestOpenIndexAction) RestSimulatePipelineAction(org.opensearch.rest.action.ingest.RestSimulatePipelineAction) RestGetAction(org.opensearch.rest.action.document.RestGetAction) RestIndicesAction(org.opensearch.rest.action.cat.RestIndicesAction) RestResolveIndexAction(org.opensearch.rest.action.admin.indices.RestResolveIndexAction) RestCountAction(org.opensearch.rest.action.search.RestCountAction) RestFieldCapabilitiesAction(org.opensearch.rest.action.RestFieldCapabilitiesAction) RestCancelTasksAction(org.opensearch.rest.action.admin.cluster.RestCancelTasksAction) RestAddIndexBlockAction(org.opensearch.rest.action.admin.indices.RestAddIndexBlockAction) RestAddVotingConfigExclusionAction(org.opensearch.rest.action.admin.cluster.RestAddVotingConfigExclusionAction) RestAnalyzeAction(org.opensearch.rest.action.admin.indices.RestAnalyzeAction) RestSyncedFlushAction(org.opensearch.rest.action.admin.indices.RestSyncedFlushAction) CreateHandler(org.opensearch.rest.action.document.RestIndexAction.CreateHandler) RestCreateSnapshotAction(org.opensearch.rest.action.admin.cluster.RestCreateSnapshotAction) RestSimulateTemplateAction(org.opensearch.rest.action.admin.indices.RestSimulateTemplateAction) RestGetTaskAction(org.opensearch.rest.action.admin.cluster.RestGetTaskAction) RestMainAction(org.opensearch.rest.action.RestMainAction) RestDeleteSnapshotAction(org.opensearch.rest.action.admin.cluster.RestDeleteSnapshotAction) RestClusterHealthAction(org.opensearch.rest.action.admin.cluster.RestClusterHealthAction) RestRefreshAction(org.opensearch.rest.action.admin.indices.RestRefreshAction) RestClusterGetSettingsAction(org.opensearch.rest.action.admin.cluster.RestClusterGetSettingsAction) RestSnapshotsStatusAction(org.opensearch.rest.action.admin.cluster.RestSnapshotsStatusAction) RestResizeHandler(org.opensearch.rest.action.admin.indices.RestResizeHandler) RestNodesInfoAction(org.opensearch.rest.action.admin.cluster.RestNodesInfoAction) RestGetIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestGetIndexTemplateAction) RestAliasAction(org.opensearch.rest.action.cat.RestAliasAction) RestClusterRerouteAction(org.opensearch.rest.action.admin.cluster.RestClusterRerouteAction) RestTemplatesAction(org.opensearch.rest.action.cat.RestTemplatesAction) RestSearchAction(org.opensearch.rest.action.search.RestSearchAction) RestPutComposableIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestPutComposableIndexTemplateAction) RestCreateDataStreamAction(org.opensearch.rest.action.admin.indices.RestCreateDataStreamAction) RestNodesAction(org.opensearch.rest.action.cat.RestNodesAction) RestGetIndicesAction(org.opensearch.rest.action.admin.indices.RestGetIndicesAction) RestThreadPoolAction(org.opensearch.rest.action.cat.RestThreadPoolAction) RestDeleteComposableIndexTemplateAction(org.opensearch.rest.action.admin.indices.RestDeleteComposableIndexTemplateAction) RestHealthAction(org.opensearch.rest.action.cat.RestHealthAction) RestFielddataAction(org.opensearch.rest.action.cat.RestFielddataAction) RestRemoteClusterInfoAction(org.opensearch.rest.action.admin.cluster.RestRemoteClusterInfoAction) RestUpgradeAction(org.opensearch.rest.action.admin.indices.RestUpgradeAction) RestSegmentsAction(org.opensearch.rest.action.cat.RestSegmentsAction) RestClusterUpdateSettingsAction(org.opensearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction) RestGetSnapshotsAction(org.opensearch.rest.action.admin.cluster.RestGetSnapshotsAction) RestGetFieldMappingAction(org.opensearch.rest.action.admin.indices.RestGetFieldMappingAction) RestGetSourceAction(org.opensearch.rest.action.document.RestGetSourceAction) RestNodesHotThreadsAction(org.opensearch.rest.action.admin.cluster.RestNodesHotThreadsAction) RestDeleteStoredScriptAction(org.opensearch.rest.action.admin.cluster.RestDeleteStoredScriptAction) RestClusterStateAction(org.opensearch.rest.action.admin.cluster.RestClusterStateAction) RestUpgradeStatusAction(org.opensearch.rest.action.admin.indices.RestUpgradeStatusAction) RestClusterSearchShardsAction(org.opensearch.rest.action.admin.cluster.RestClusterSearchShardsAction) RestPluginsAction(org.opensearch.rest.action.cat.RestPluginsAction) RestGetAliasesAction(org.opensearch.rest.action.admin.indices.RestGetAliasesAction) RestMultiGetAction(org.opensearch.rest.action.document.RestMultiGetAction) RestClusterStatsAction(org.opensearch.rest.action.admin.cluster.RestClusterStatsAction) RestCreateIndexAction(org.opensearch.rest.action.admin.indices.RestCreateIndexAction) RestSnapshotAction(org.opensearch.rest.action.cat.RestSnapshotAction) RestClearVotingConfigExclusionsAction(org.opensearch.rest.action.admin.cluster.RestClearVotingConfigExclusionsAction) RestRepositoriesAction(org.opensearch.rest.action.cat.RestRepositoriesAction) RestGetScriptLanguageAction(org.opensearch.rest.action.admin.cluster.RestGetScriptLanguageAction) RestListDanglingIndicesAction(org.opensearch.rest.action.admin.cluster.dangling.RestListDanglingIndicesAction) RestGetDataStreamsAction(org.opensearch.rest.action.admin.indices.RestGetDataStreamsAction) RestDeleteComponentTemplateAction(org.opensearch.rest.action.admin.indices.RestDeleteComponentTemplateAction) RestIndicesSegmentsAction(org.opensearch.rest.action.admin.indices.RestIndicesSegmentsAction) RestMultiTermVectorsAction(org.opensearch.rest.action.document.RestMultiTermVectorsAction) RestClusterAllocationExplainAction(org.opensearch.rest.action.admin.cluster.RestClusterAllocationExplainAction) RestIndexDeleteAliasesAction(org.opensearch.rest.action.admin.indices.RestIndexDeleteAliasesAction) RestCatRecoveryAction(org.opensearch.rest.action.cat.RestCatRecoveryAction) RestBulkAction(org.opensearch.rest.action.document.RestBulkAction) RestIndicesShardStoresAction(org.opensearch.rest.action.admin.indices.RestIndicesShardStoresAction) RestCloneSnapshotAction(org.opensearch.rest.action.admin.cluster.RestCloneSnapshotAction) RestCloseIndexAction(org.opensearch.rest.action.admin.indices.RestCloseIndexAction) RestGetRepositoriesAction(org.opensearch.rest.action.admin.cluster.RestGetRepositoriesAction) RestListTasksAction(org.opensearch.rest.action.admin.cluster.RestListTasksAction) RestValidateQueryAction(org.opensearch.rest.action.admin.indices.RestValidateQueryAction) RestIndicesStatsAction(org.opensearch.rest.action.admin.indices.RestIndicesStatsAction) RestForceMergeAction(org.opensearch.rest.action.admin.indices.RestForceMergeAction) RestCleanupRepositoryAction(org.opensearch.rest.action.admin.cluster.RestCleanupRepositoryAction) RestUpdateSettingsAction(org.opensearch.rest.action.admin.indices.RestUpdateSettingsAction) RestPutStoredScriptAction(org.opensearch.rest.action.admin.cluster.RestPutStoredScriptAction) RestDeleteIndexAction(org.opensearch.rest.action.admin.indices.RestDeleteIndexAction) RestIndexAction(org.opensearch.rest.action.document.RestIndexAction) RestRecoveryAction(org.opensearch.rest.action.admin.indices.RestRecoveryAction) RestShardsAction(org.opensearch.rest.action.cat.RestShardsAction) RestPutComponentTemplateAction(org.opensearch.rest.action.admin.indices.RestPutComponentTemplateAction) RestNodesStatsAction(org.opensearch.rest.action.admin.cluster.RestNodesStatsAction) RestFlushAction(org.opensearch.rest.action.admin.indices.RestFlushAction) RestTermVectorsAction(org.opensearch.rest.action.document.RestTermVectorsAction) RestNodeAttrsAction(org.opensearch.rest.action.cat.RestNodeAttrsAction) RestGetSettingsAction(org.opensearch.rest.action.admin.indices.RestGetSettingsAction) RestDeleteAction(org.opensearch.rest.action.document.RestDeleteAction) RestNodesUsageAction(org.opensearch.rest.action.admin.cluster.RestNodesUsageAction)

Example 2 with ThreadPool

use of org.opensearch.threadpool.ThreadPool in project OpenSearch by opensearch-project.

the class RetryTests method blockExecutor.

/**
 * Blocks the named executor by getting its only thread running a task blocked on a CyclicBarrier and fills the queue with a noop task.
 * So requests to use this queue should get {@link OpenSearchRejectedExecutionException}s.
 */
private CyclicBarrier blockExecutor(String name, String node) throws Exception {
    ThreadPool threadPool = internalCluster().getInstance(ThreadPool.class, node);
    CyclicBarrier barrier = new CyclicBarrier(2);
    logger.info("Blocking the [{}] executor", name);
    threadPool.executor(name).execute(() -> {
        try {
            threadPool.executor(name).execute(() -> {
            });
            barrier.await();
            logger.info("Blocked the [{}] executor", name);
            barrier.await();
            logger.info("Unblocking the [{}] executor", name);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    });
    barrier.await();
    blockedExecutors.add(barrier);
    return barrier;
}
Also used : ThreadPool(org.opensearch.threadpool.ThreadPool) OpenSearchRejectedExecutionException(org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException) CyclicBarrier(java.util.concurrent.CyclicBarrier)

Example 3 with ThreadPool

use of org.opensearch.threadpool.ThreadPool in project OpenSearch by opensearch-project.

the class IndexingPressureIT method testWriteBytesAreIncremented.

public void testWriteBytesAreIncremented() throws Exception {
    assertAcked(prepareCreate(INDEX_NAME, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1)));
    ensureGreen(INDEX_NAME);
    Tuple<String, String> primaryReplicaNodeNames = getPrimaryReplicaNodeNames();
    String primaryName = primaryReplicaNodeNames.v1();
    String replicaName = primaryReplicaNodeNames.v2();
    String coordinatingOnlyNode = getCoordinatingOnlyNode();
    final CountDownLatch replicationSendPointReached = new CountDownLatch(1);
    final CountDownLatch latchBlockingReplicationSend = new CountDownLatch(1);
    TransportService primaryService = internalCluster().getInstance(TransportService.class, primaryName);
    final MockTransportService primaryTransportService = (MockTransportService) primaryService;
    TransportService replicaService = internalCluster().getInstance(TransportService.class, replicaName);
    final MockTransportService replicaTransportService = (MockTransportService) replicaService;
    primaryTransportService.addSendBehavior((connection, requestId, action, request, options) -> {
        if (action.equals(TransportShardBulkAction.ACTION_NAME + "[r]")) {
            try {
                replicationSendPointReached.countDown();
                latchBlockingReplicationSend.await();
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }
        }
        connection.sendRequest(requestId, action, request, options);
    });
    final ThreadPool replicaThreadPool = replicaTransportService.getThreadPool();
    final Releasable replicaRelease = blockReplicas(replicaThreadPool);
    final BulkRequest bulkRequest = new BulkRequest();
    int totalRequestSize = 0;
    for (int i = 0; i < 80; ++i) {
        IndexRequest request = new IndexRequest(INDEX_NAME).id(UUIDs.base64UUID()).source(Collections.singletonMap("key", randomAlphaOfLength(50)));
        totalRequestSize += request.ramBytesUsed();
        assertTrue(request.ramBytesUsed() > request.source().length());
        bulkRequest.add(request);
    }
    final long bulkRequestSize = bulkRequest.ramBytesUsed();
    final long bulkShardRequestSize = totalRequestSize;
    try {
        final ActionFuture<BulkResponse> successFuture = client(coordinatingOnlyNode).bulk(bulkRequest);
        replicationSendPointReached.await();
        IndexingPressure primaryWriteLimits = internalCluster().getInstance(IndexingPressureService.class, primaryName).getShardIndexingPressure();
        IndexingPressure replicaWriteLimits = internalCluster().getInstance(IndexingPressureService.class, replicaName).getShardIndexingPressure();
        ;
        IndexingPressure coordinatingWriteLimits = internalCluster().getInstance(IndexingPressureService.class, coordinatingOnlyNode).getShardIndexingPressure();
        ;
        assertThat(primaryWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes(), greaterThan(bulkShardRequestSize));
        assertThat(primaryWriteLimits.getCurrentPrimaryBytes(), greaterThan(bulkShardRequestSize));
        assertEquals(0, primaryWriteLimits.getCurrentCoordinatingBytes());
        assertEquals(0, primaryWriteLimits.getCurrentReplicaBytes());
        assertEquals(0, replicaWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, replicaWriteLimits.getCurrentCoordinatingBytes());
        assertEquals(0, replicaWriteLimits.getCurrentPrimaryBytes());
        assertEquals(0, replicaWriteLimits.getCurrentReplicaBytes());
        assertEquals(bulkRequestSize, coordinatingWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(bulkRequestSize, coordinatingWriteLimits.getCurrentCoordinatingBytes());
        assertEquals(0, coordinatingWriteLimits.getCurrentPrimaryBytes());
        assertEquals(0, coordinatingWriteLimits.getCurrentReplicaBytes());
        latchBlockingReplicationSend.countDown();
        IndexRequest request = new IndexRequest(INDEX_NAME).id(UUIDs.base64UUID()).source(Collections.singletonMap("key", randomAlphaOfLength(50)));
        final BulkRequest secondBulkRequest = new BulkRequest();
        secondBulkRequest.add(request);
        // Use the primary or the replica data node as the coordinating node this time
        boolean usePrimaryAsCoordinatingNode = randomBoolean();
        final ActionFuture<BulkResponse> secondFuture;
        if (usePrimaryAsCoordinatingNode) {
            secondFuture = client(primaryName).bulk(secondBulkRequest);
        } else {
            secondFuture = client(replicaName).bulk(secondBulkRequest);
        }
        final long secondBulkRequestSize = secondBulkRequest.ramBytesUsed();
        final long secondBulkShardRequestSize = request.ramBytesUsed();
        if (usePrimaryAsCoordinatingNode) {
            assertBusy(() -> {
                assertThat(primaryWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes(), greaterThan(bulkShardRequestSize + secondBulkRequestSize));
                assertEquals(secondBulkRequestSize, primaryWriteLimits.getCurrentCoordinatingBytes());
                assertThat(primaryWriteLimits.getCurrentPrimaryBytes(), greaterThan(bulkShardRequestSize + secondBulkRequestSize));
                assertEquals(0, replicaWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
                assertEquals(0, replicaWriteLimits.getCurrentCoordinatingBytes());
                assertEquals(0, replicaWriteLimits.getCurrentPrimaryBytes());
            });
        } else {
            assertThat(primaryWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes(), greaterThan(bulkShardRequestSize));
            assertEquals(secondBulkRequestSize, replicaWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
            assertEquals(secondBulkRequestSize, replicaWriteLimits.getCurrentCoordinatingBytes());
            assertEquals(0, replicaWriteLimits.getCurrentPrimaryBytes());
        }
        assertEquals(bulkRequestSize, coordinatingWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertBusy(() -> assertThat(replicaWriteLimits.getCurrentReplicaBytes(), greaterThan(bulkShardRequestSize + secondBulkShardRequestSize)));
        replicaRelease.close();
        successFuture.actionGet();
        secondFuture.actionGet();
        assertEquals(0, primaryWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, primaryWriteLimits.getCurrentCoordinatingBytes());
        assertEquals(0, primaryWriteLimits.getCurrentPrimaryBytes());
        assertEquals(0, primaryWriteLimits.getCurrentReplicaBytes());
        assertEquals(0, replicaWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, replicaWriteLimits.getCurrentCoordinatingBytes());
        assertEquals(0, replicaWriteLimits.getCurrentPrimaryBytes());
        assertEquals(0, replicaWriteLimits.getCurrentReplicaBytes());
        assertEquals(0, coordinatingWriteLimits.getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, coordinatingWriteLimits.getCurrentCoordinatingBytes());
        assertEquals(0, coordinatingWriteLimits.getCurrentPrimaryBytes());
        assertEquals(0, coordinatingWriteLimits.getCurrentReplicaBytes());
    } finally {
        if (replicationSendPointReached.getCount() > 0) {
            replicationSendPointReached.countDown();
        }
        replicaRelease.close();
        if (latchBlockingReplicationSend.getCount() > 0) {
            latchBlockingReplicationSend.countDown();
        }
        replicaRelease.close();
        primaryTransportService.clearAllRules();
    }
}
Also used : MockTransportService(org.opensearch.test.transport.MockTransportService) ThreadPool(org.opensearch.threadpool.ThreadPool) BulkResponse(org.opensearch.action.bulk.BulkResponse) CountDownLatch(java.util.concurrent.CountDownLatch) IndexRequest(org.opensearch.action.index.IndexRequest) MockTransportService(org.opensearch.test.transport.MockTransportService) TransportService(org.opensearch.transport.TransportService) BulkRequest(org.opensearch.action.bulk.BulkRequest) Releasable(org.opensearch.common.lease.Releasable)

Example 4 with ThreadPool

use of org.opensearch.threadpool.ThreadPool in project OpenSearch by opensearch-project.

the class ShardIndexingPressureIT method testShardIndexingPressureTrackingDuringBulkWrites.

public void testShardIndexingPressureTrackingDuringBulkWrites() throws Exception {
    assertAcked(prepareCreate(INDEX_NAME, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1)));
    ensureGreen(INDEX_NAME);
    Tuple<String, String> primaryReplicaNodeNames = getPrimaryReplicaNodeNames(INDEX_NAME);
    String primaryName = primaryReplicaNodeNames.v1();
    String replicaName = primaryReplicaNodeNames.v2();
    String coordinatingOnlyNode = getCoordinatingOnlyNode();
    final CountDownLatch replicationSendPointReached = new CountDownLatch(1);
    final CountDownLatch latchBlockingReplicationSend = new CountDownLatch(1);
    TransportService primaryService = internalCluster().getInstance(TransportService.class, primaryName);
    final MockTransportService primaryTransportService = (MockTransportService) primaryService;
    TransportService replicaService = internalCluster().getInstance(TransportService.class, replicaName);
    final MockTransportService replicaTransportService = (MockTransportService) replicaService;
    primaryTransportService.addSendBehavior((connection, requestId, action, request, options) -> {
        if (action.equals(TransportShardBulkAction.ACTION_NAME + "[r]")) {
            try {
                replicationSendPointReached.countDown();
                latchBlockingReplicationSend.await();
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }
        }
        connection.sendRequest(requestId, action, request, options);
    });
    final ThreadPool replicaThreadPool = replicaTransportService.getThreadPool();
    final Releasable replicaRelease = blockReplicas(replicaThreadPool);
    final BulkRequest bulkRequest = new BulkRequest();
    int totalRequestSize = 0;
    for (int i = 0; i < 80; ++i) {
        IndexRequest request = new IndexRequest(INDEX_NAME).id(UUIDs.base64UUID()).source(Collections.singletonMap("key", randomAlphaOfLength(50)));
        totalRequestSize += request.ramBytesUsed();
        assertTrue(request.ramBytesUsed() > request.source().length());
        bulkRequest.add(request);
    }
    final long bulkShardRequestSize = totalRequestSize + (RamUsageEstimator.shallowSizeOfInstance(BulkItemRequest.class) * 80) + RamUsageEstimator.shallowSizeOfInstance(BulkShardRequest.class);
    try {
        final ActionFuture<BulkResponse> successFuture = client(coordinatingOnlyNode).bulk(bulkRequest);
        replicationSendPointReached.await();
        IndexService indexService = internalCluster().getInstance(IndicesService.class, primaryName).iterator().next();
        Index index = indexService.getIndexSettings().getIndex();
        ShardId shardId = new ShardId(index, 0);
        ShardIndexingPressureTracker primaryShardTracker = internalCluster().getInstance(IndexingPressureService.class, primaryName).getShardIndexingPressure().getShardIndexingPressureTracker(shardId);
        ShardIndexingPressureTracker replicaShardTracker = internalCluster().getInstance(IndexingPressureService.class, replicaName).getShardIndexingPressure().getShardIndexingPressureTracker(shardId);
        ShardIndexingPressureTracker coordinatingShardTracker = internalCluster().getInstance(IndexingPressureService.class, coordinatingOnlyNode).getShardIndexingPressure().getShardIndexingPressureTracker(shardId);
        assertThat(primaryShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes(), equalTo(bulkShardRequestSize));
        assertThat(primaryShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes(), equalTo(bulkShardRequestSize));
        assertEquals(0, primaryShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, primaryShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, replicaShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, replicaShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, replicaShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, replicaShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(bulkShardRequestSize, coordinatingShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(bulkShardRequestSize, coordinatingShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, coordinatingShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, coordinatingShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
        latchBlockingReplicationSend.countDown();
        IndexRequest request = new IndexRequest(INDEX_NAME).id(UUIDs.base64UUID()).source(Collections.singletonMap("key", randomAlphaOfLength(50)));
        final BulkRequest secondBulkRequest = new BulkRequest();
        secondBulkRequest.add(request);
        // Use the primary or the replica data node as the coordinating node this time
        boolean usePrimaryAsCoordinatingNode = randomBoolean();
        final ActionFuture<BulkResponse> secondFuture;
        if (usePrimaryAsCoordinatingNode) {
            secondFuture = client(primaryName).bulk(secondBulkRequest);
        } else {
            secondFuture = client(replicaName).bulk(secondBulkRequest);
        }
        final long secondBulkShardRequestSize = request.ramBytesUsed() + RamUsageEstimator.shallowSizeOfInstance(BulkItemRequest.class) + RamUsageEstimator.shallowSizeOfInstance(BulkShardRequest.class);
        if (usePrimaryAsCoordinatingNode) {
            assertBusy(() -> {
                assertThat(primaryShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes(), equalTo(bulkShardRequestSize + secondBulkShardRequestSize));
                assertEquals(secondBulkShardRequestSize, primaryShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
                assertThat(primaryShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes(), equalTo(bulkShardRequestSize + secondBulkShardRequestSize));
                assertEquals(0, replicaShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
                assertEquals(0, replicaShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
                assertEquals(0, replicaShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes());
            });
        } else {
            assertThat(primaryShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes(), equalTo(bulkShardRequestSize));
            assertEquals(secondBulkShardRequestSize, replicaShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
            assertEquals(secondBulkShardRequestSize, replicaShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
            assertEquals(0, replicaShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes());
        }
        assertEquals(bulkShardRequestSize, coordinatingShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertBusy(() -> assertThat(replicaShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes(), equalTo(bulkShardRequestSize + secondBulkShardRequestSize)));
        replicaRelease.close();
        successFuture.actionGet();
        secondFuture.actionGet();
        assertEquals(0, primaryShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, primaryShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, primaryShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, primaryShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, replicaShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, replicaShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, replicaShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, replicaShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, coordinatingShardTracker.getCommonOperationTracker().getCurrentCombinedCoordinatingAndPrimaryBytes());
        assertEquals(0, coordinatingShardTracker.getCoordinatingOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, coordinatingShardTracker.getPrimaryOperationTracker().getStatsTracker().getCurrentBytes());
        assertEquals(0, coordinatingShardTracker.getReplicaOperationTracker().getStatsTracker().getCurrentBytes());
    } finally {
        if (replicationSendPointReached.getCount() > 0) {
            replicationSendPointReached.countDown();
        }
        replicaRelease.close();
        if (latchBlockingReplicationSend.getCount() > 0) {
            latchBlockingReplicationSend.countDown();
        }
        replicaRelease.close();
        primaryTransportService.clearAllRules();
    }
}
Also used : BulkShardRequest(org.opensearch.action.bulk.BulkShardRequest) MockTransportService(org.opensearch.test.transport.MockTransportService) ThreadPool(org.opensearch.threadpool.ThreadPool) BulkResponse(org.opensearch.action.bulk.BulkResponse) CountDownLatch(java.util.concurrent.CountDownLatch) IndexRequest(org.opensearch.action.index.IndexRequest) ShardId(org.opensearch.index.shard.ShardId) MockTransportService(org.opensearch.test.transport.MockTransportService) TransportService(org.opensearch.transport.TransportService) BulkRequest(org.opensearch.action.bulk.BulkRequest) Releasable(org.opensearch.common.lease.Releasable)

Example 5 with ThreadPool

use of org.opensearch.threadpool.ThreadPool in project OpenSearch by opensearch-project.

the class ShardIndexingPressureSettingsIT method testShardIndexingPressureRequestSizeWindowSettingUpdate.

public void testShardIndexingPressureRequestSizeWindowSettingUpdate() throws Exception {
    final BulkRequest bulkRequest = new BulkRequest();
    int totalRequestSize = 0;
    for (int i = 0; i < 80; ++i) {
        IndexRequest request = new IndexRequest(INDEX_NAME).id(UUIDs.base64UUID()).source(Collections.singletonMap("key", randomAlphaOfLength(50)));
        totalRequestSize += request.ramBytesUsed();
        assertTrue(request.ramBytesUsed() > request.source().length());
        bulkRequest.add(request);
    }
    final long bulkShardRequestSize = totalRequestSize + (RamUsageEstimator.shallowSizeOfInstance(BulkItemRequest.class) * 80) + RamUsageEstimator.shallowSizeOfInstance(BulkShardRequest.class);
    Settings settings = Settings.builder().put(ShardIndexingPressureSettings.SHARD_INDEXING_PRESSURE_ENABLED.getKey(), true).put(ShardIndexingPressureSettings.SHARD_INDEXING_PRESSURE_ENFORCED.getKey(), true).put(IndexingPressure.MAX_INDEXING_BYTES.getKey(), (long) (bulkShardRequestSize * 1.2) + "B").put(ShardIndexingPressureSettings.REQUEST_SIZE_WINDOW.getKey(), 1).put(ShardIndexingPressureMemoryManager.THROUGHPUT_DEGRADATION_LIMITS.getKey(), 1).build();
    restartCluster(settings);
    assertAcked(prepareCreate(INDEX_NAME, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1)));
    ensureGreen(INDEX_NAME);
    Tuple<String, String> primaryReplicaNodeNames = getPrimaryReplicaNodeNames(INDEX_NAME);
    String primaryName = primaryReplicaNodeNames.v1();
    String replicaName = primaryReplicaNodeNames.v2();
    String coordinatingOnlyNode = getCoordinatingOnlyNode();
    IndexService indexService = internalCluster().getInstance(IndicesService.class, primaryName).iterator().next();
    Index index = indexService.getIndexSettings().getIndex();
    ShardId shardId = new ShardId(index, 0);
    boolean randomBoolean = randomBoolean();
    // Send first request which gets successful
    ActionFuture<BulkResponse> successFuture;
    if (randomBoolean) {
        successFuture = client(coordinatingOnlyNode).bulk(bulkRequest);
    } else {
        successFuture = client(primaryName).bulk(bulkRequest);
    }
    successFuture.actionGet();
    final CountDownLatch replicationSendPointReached = new CountDownLatch(1);
    final CountDownLatch latchBlockingReplicationSend = new CountDownLatch(1);
    TransportService primaryService = internalCluster().getInstance(TransportService.class, primaryName);
    final MockTransportService primaryTransportService = (MockTransportService) primaryService;
    TransportService replicaService = internalCluster().getInstance(TransportService.class, replicaName);
    final MockTransportService replicaTransportService = (MockTransportService) replicaService;
    primaryTransportService.addSendBehavior((connection, requestId, action, request, options) -> {
        if (action.equals(TransportShardBulkAction.ACTION_NAME + "[r]")) {
            try {
                replicationSendPointReached.countDown();
                latchBlockingReplicationSend.await();
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }
        }
        connection.sendRequest(requestId, action, request, options);
    });
    final ThreadPool replicaThreadPool = replicaTransportService.getThreadPool();
    final Releasable replicaRelease = blockReplicas(replicaThreadPool);
    // Send one more requests which remains outstanding for delayed time
    if (randomBoolean) {
        successFuture = client(coordinatingOnlyNode).bulk(bulkRequest);
    } else {
        successFuture = client(primaryName).bulk(bulkRequest);
    }
    // Delay to breach the success time stamp threshold
    Thread.sleep(3000);
    latchBlockingReplicationSend.countDown();
    replicaRelease.close();
    successFuture.actionGet();
    // This request breaches the threshold and hence will be rejected
    if (randomBoolean) {
        expectThrows(OpenSearchRejectedExecutionException.class, () -> client(coordinatingOnlyNode).bulk(bulkRequest).actionGet());
    } else {
        expectThrows(OpenSearchRejectedExecutionException.class, () -> client(primaryName).bulk(bulkRequest).actionGet());
    }
    // Update the outstanding threshold setting to see no rejections
    ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest();
    updateSettingsRequest.persistentSettings(Settings.builder().put(ShardIndexingPressureSettings.REQUEST_SIZE_WINDOW.getKey(), 10));
    assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet());
    // Verify no rejection with similar request pattern
    if (randomBoolean) {
        successFuture = client(coordinatingOnlyNode).bulk(bulkRequest);
        successFuture.actionGet();
        successFuture = client(coordinatingOnlyNode).bulk(bulkRequest);
        Thread.sleep(10);
        successFuture.actionGet();
        client(coordinatingOnlyNode).bulk(bulkRequest).actionGet();
        ShardIndexingPressureTracker coordinatingShardTracker = internalCluster().getInstance(IndexingPressureService.class, coordinatingOnlyNode).getShardIndexingPressure().getShardIndexingPressureTracker(shardId);
        assertEquals(1, coordinatingShardTracker.getCoordinatingOperationTracker().getRejectionTracker().getTotalRejections());
        assertEquals(1, coordinatingShardTracker.getCoordinatingOperationTracker().getRejectionTracker().getThroughputDegradationLimitsBreachedRejections());
    } else {
        successFuture = client(primaryName).bulk(bulkRequest);
        successFuture.actionGet();
        successFuture = client(primaryName).bulk(bulkRequest);
        Thread.sleep(10);
        successFuture.actionGet();
        client(primaryName).bulk(bulkRequest).actionGet();
        ShardIndexingPressureTracker primaryShardTracker = internalCluster().getInstance(IndexingPressureService.class, primaryName).getShardIndexingPressure().getShardIndexingPressureTracker(shardId);
        assertEquals(1, primaryShardTracker.getCoordinatingOperationTracker().getRejectionTracker().getTotalRejections());
        assertEquals(1, primaryShardTracker.getCoordinatingOperationTracker().getRejectionTracker().getThroughputDegradationLimitsBreachedRejections());
    }
}
Also used : BulkShardRequest(org.opensearch.action.bulk.BulkShardRequest) MockTransportService(org.opensearch.test.transport.MockTransportService) ThreadPool(org.opensearch.threadpool.ThreadPool) BulkResponse(org.opensearch.action.bulk.BulkResponse) IndexRequest(org.opensearch.action.index.IndexRequest) CountDownLatch(java.util.concurrent.CountDownLatch) ClusterUpdateSettingsRequest(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest) ShardId(org.opensearch.index.shard.ShardId) MockTransportService(org.opensearch.test.transport.MockTransportService) TransportService(org.opensearch.transport.TransportService) BulkRequest(org.opensearch.action.bulk.BulkRequest) Releasable(org.opensearch.common.lease.Releasable) Settings(org.opensearch.common.settings.Settings)

Aggregations

ThreadPool (org.opensearch.threadpool.ThreadPool)152 Settings (org.opensearch.common.settings.Settings)87 TestThreadPool (org.opensearch.threadpool.TestThreadPool)85 Collections (java.util.Collections)56 OpenSearchTestCase (org.opensearch.test.OpenSearchTestCase)56 ActionListener (org.opensearch.action.ActionListener)54 List (java.util.List)53 ClusterService (org.opensearch.cluster.service.ClusterService)50 Version (org.opensearch.Version)49 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)49 ClusterState (org.opensearch.cluster.ClusterState)48 TimeUnit (java.util.concurrent.TimeUnit)45 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)45 TransportService (org.opensearch.transport.TransportService)45 ArrayList (java.util.ArrayList)43 CountDownLatch (java.util.concurrent.CountDownLatch)43 TimeValue (org.opensearch.common.unit.TimeValue)43 IOException (java.io.IOException)42 ShardId (org.opensearch.index.shard.ShardId)42 Set (java.util.Set)41