Search in sources :

Example 31 with IndexNotFoundException

use of org.opensearch.index.IndexNotFoundException in project OpenSearch by opensearch-project.

the class WildcardExpressionResolverTests method testResolveAliases.

public void testResolveAliases() {
    Metadata.Builder mdBuilder = Metadata.builder().put(indexBuilder("foo_foo").state(State.OPEN)).put(indexBuilder("bar_bar").state(State.OPEN)).put(indexBuilder("foo_index").state(State.OPEN).putAlias(AliasMetadata.builder("foo_alias"))).put(indexBuilder("bar_index").state(State.OPEN).putAlias(AliasMetadata.builder("foo_alias")));
    ClusterState state = ClusterState.builder(new ClusterName("_name")).metadata(mdBuilder).build();
    IndexNameExpressionResolver.WildcardExpressionResolver resolver = new IndexNameExpressionResolver.WildcardExpressionResolver();
    // when ignoreAliases option is not set, WildcardExpressionResolver resolves the provided
    // expressions against the defined indices and aliases
    IndicesOptions indicesAndAliasesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), true, false, true, false, false, false);
    IndexNameExpressionResolver.Context indicesAndAliasesContext = new IndexNameExpressionResolver.Context(state, indicesAndAliasesOptions, false);
    // ignoreAliases option is set, WildcardExpressionResolver throws error when
    IndicesOptions skipAliasesIndicesOptions = IndicesOptions.fromOptions(true, true, true, false, true, false, true, false);
    IndexNameExpressionResolver.Context skipAliasesLenientContext = new IndexNameExpressionResolver.Context(state, skipAliasesIndicesOptions, false);
    // ignoreAliases option is set, WildcardExpressionResolver resolves the provided expressions only against the defined indices
    IndicesOptions errorOnAliasIndicesOptions = IndicesOptions.fromOptions(false, false, true, false, true, false, true, false);
    IndexNameExpressionResolver.Context skipAliasesStrictContext = new IndexNameExpressionResolver.Context(state, errorOnAliasIndicesOptions, false);
    {
        List<String> indices = resolver.resolve(indicesAndAliasesContext, Collections.singletonList("foo_a*"));
        assertThat(indices, containsInAnyOrder("foo_index", "bar_index"));
    }
    {
        List<String> indices = resolver.resolve(skipAliasesLenientContext, Collections.singletonList("foo_a*"));
        assertEquals(0, indices.size());
    }
    {
        IndexNotFoundException infe = expectThrows(IndexNotFoundException.class, () -> resolver.resolve(skipAliasesStrictContext, Collections.singletonList("foo_a*")));
        assertEquals("foo_a*", infe.getIndex().getName());
    }
    {
        List<String> indices = resolver.resolve(indicesAndAliasesContext, Collections.singletonList("foo*"));
        assertThat(indices, containsInAnyOrder("foo_foo", "foo_index", "bar_index"));
    }
    {
        List<String> indices = resolver.resolve(skipAliasesLenientContext, Collections.singletonList("foo*"));
        assertThat(indices, containsInAnyOrder("foo_foo", "foo_index"));
    }
    {
        List<String> indices = resolver.resolve(skipAliasesStrictContext, Collections.singletonList("foo*"));
        assertThat(indices, containsInAnyOrder("foo_foo", "foo_index"));
    }
    {
        List<String> indices = resolver.resolve(indicesAndAliasesContext, Collections.singletonList("foo_alias"));
        assertThat(indices, containsInAnyOrder("foo_alias"));
    }
    {
        List<String> indices = resolver.resolve(skipAliasesLenientContext, Collections.singletonList("foo_alias"));
        assertThat(indices, containsInAnyOrder("foo_alias"));
    }
    {
        IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> resolver.resolve(skipAliasesStrictContext, Collections.singletonList("foo_alias")));
        assertEquals("The provided expression [foo_alias] matches an alias, " + "specify the corresponding concrete indices instead.", iae.getMessage());
    }
}
Also used : ClusterState(org.opensearch.cluster.ClusterState) ClusterName(org.opensearch.cluster.ClusterName) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) List(java.util.List) IndicesOptions(org.opensearch.action.support.IndicesOptions)

Example 32 with IndexNotFoundException

use of org.opensearch.index.IndexNotFoundException in project OpenSearch by opensearch-project.

the class IndexNameExpressionResolverTests method testIndexOptionsEmptyCluster.

public void testIndexOptionsEmptyCluster() {
    ClusterState state = ClusterState.builder(new ClusterName("_name")).metadata(Metadata.builder().build()).build();
    IndicesOptions options = IndicesOptions.strictExpandOpen();
    final IndexNameExpressionResolver.Context context = new IndexNameExpressionResolver.Context(state, options, false);
    String[] results = indexNameExpressionResolver.concreteIndexNames(context, Strings.EMPTY_ARRAY);
    assertThat(results, emptyArray());
    {
        IndexNotFoundException infe = expectThrows(IndexNotFoundException.class, () -> indexNameExpressionResolver.concreteIndexNames(context, "foo"));
        assertThat(infe.getIndex().getName(), equalTo("foo"));
    }
    results = indexNameExpressionResolver.concreteIndexNames(context, "foo*");
    assertThat(results, emptyArray());
    {
        IndexNotFoundException infe = expectThrows(IndexNotFoundException.class, () -> indexNameExpressionResolver.concreteIndexNames(context, "foo*", "bar"));
        assertThat(infe.getIndex().getName(), equalTo("bar"));
    }
    final IndexNameExpressionResolver.Context context2 = new IndexNameExpressionResolver.Context(state, IndicesOptions.lenientExpandOpen(), false);
    results = indexNameExpressionResolver.concreteIndexNames(context2, Strings.EMPTY_ARRAY);
    assertThat(results, emptyArray());
    results = indexNameExpressionResolver.concreteIndexNames(context2, "foo");
    assertThat(results, emptyArray());
    results = indexNameExpressionResolver.concreteIndexNames(context2, "foo*");
    assertThat(results, emptyArray());
    results = indexNameExpressionResolver.concreteIndexNames(context2, "foo*", "bar");
    assertThat(results, emptyArray());
    final IndexNameExpressionResolver.Context context3 = new IndexNameExpressionResolver.Context(state, IndicesOptions.fromOptions(true, false, true, false), false);
    IndexNotFoundException infe = expectThrows(IndexNotFoundException.class, () -> indexNameExpressionResolver.concreteIndexNames(context3, Strings.EMPTY_ARRAY));
    assertThat(infe.getResourceId().toString(), equalTo("[_all]"));
}
Also used : ThreadContext(org.opensearch.common.util.concurrent.ThreadContext) ClusterState(org.opensearch.cluster.ClusterState) ClusterName(org.opensearch.cluster.ClusterName) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) Matchers.containsString(org.hamcrest.Matchers.containsString) IndicesOptions(org.opensearch.action.support.IndicesOptions)

Example 33 with IndexNotFoundException

use of org.opensearch.index.IndexNotFoundException in project OpenSearch by opensearch-project.

the class MetadataDeleteIndexServiceTests method testDeleteMissing.

public void testDeleteMissing() {
    Index index = new Index("missing", "doesn't matter");
    ClusterState state = ClusterState.builder(ClusterName.DEFAULT).build();
    IndexNotFoundException e = expectThrows(IndexNotFoundException.class, () -> service.deleteIndices(state, singleton(index)));
    assertEquals(index, e.getIndex());
}
Also used : ClusterState(org.opensearch.cluster.ClusterState) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) Index(org.opensearch.index.Index)

Example 34 with IndexNotFoundException

use of org.opensearch.index.IndexNotFoundException in project anomaly-detection by opensearch-project.

the class AnomalyDetectionIndices method deleteIndexIteration.

private void deleteIndexIteration(String[] toDelete) {
    for (String index : toDelete) {
        DeleteIndexRequest singleDeleteRequest = new DeleteIndexRequest(index);
        adminClient.indices().delete(singleDeleteRequest, ActionListener.wrap(singleDeleteResponse -> {
            if (!singleDeleteResponse.isAcknowledged()) {
                logger.error("Retrying deleting {} does not succeed.", index);
            }
        }, exception -> {
            if (exception instanceof IndexNotFoundException) {
                logger.info("{} was already deleted.", index);
            } else {
                logger.error(new ParameterizedMessage("Retrying deleting {} does not succeed.", index), exception);
            }
        }));
    }
}
Also used : DUMMY_AD_RESULT_ID(org.opensearch.ad.constant.CommonName.DUMMY_AD_RESULT_ID) Arrays(java.util.Arrays) UpdateSettingsRequest(org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest) URL(java.net.URL) ToXContent(org.opensearch.common.xcontent.ToXContent) Strings(org.opensearch.common.Strings) ANOMALY_RESULTS_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_RESULTS_INDEX_MAPPING_FILE) CHECKPOINT_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.CHECKPOINT_INDEX_MAPPING_FILE) AnomalyDetectorFunction(org.opensearch.ad.rest.handler.AnomalyDetectorFunction) XContentParser(org.opensearch.common.xcontent.XContentParser) GroupedActionListener(org.opensearch.action.support.GroupedActionListener) ObjectObjectCursor(com.carrotsearch.hppc.cursors.ObjectObjectCursor) Alias(org.opensearch.action.admin.indices.alias.Alias) Token(org.opensearch.common.xcontent.XContentParser.Token) Map(java.util.Map) ANOMALY_DETECTION_STATE_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_DETECTION_STATE_INDEX_MAPPING_FILE) ActionListener(org.opensearch.action.ActionListener) MAX_PRIMARY_SHARDS(org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_PRIMARY_SHARDS) CreateIndexRequest(org.opensearch.action.admin.indices.create.CreateIndexRequest) DeleteRequest(org.opensearch.action.delete.DeleteRequest) RolloverRequest(org.opensearch.action.admin.indices.rollover.RolloverRequest) ANOMALY_DETECTORS_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_DETECTORS_INDEX_MAPPING_FILE) Client(org.opensearch.client.Client) TimeValue(org.opensearch.common.unit.TimeValue) AD_RESULT_HISTORY_MAX_DOCS_PER_SHARD(org.opensearch.ad.settings.AnomalyDetectorSettings.AD_RESULT_HISTORY_MAX_DOCS_PER_SHARD) EnumMap(java.util.EnumMap) AdminClient(org.opensearch.client.AdminClient) PutMappingRequest(org.opensearch.action.admin.indices.mapping.put.PutMappingRequest) LocalNodeMasterListener(org.opensearch.cluster.LocalNodeMasterListener) LoggingDeprecationHandler(org.opensearch.common.xcontent.LoggingDeprecationHandler) Set(java.util.Set) ExceptionsHelper(org.opensearch.ExceptionsHelper) Settings(org.opensearch.common.settings.Settings) Instant(java.time.Instant) ObjectCursor(com.carrotsearch.hppc.cursors.ObjectCursor) List(java.util.List) Logger(org.apache.logging.log4j.Logger) AnomalyResult(org.opensearch.ad.model.AnomalyResult) BytesArray(org.opensearch.common.bytes.BytesArray) ResourceAlreadyExistsException(org.opensearch.ResourceAlreadyExistsException) XContentType(org.opensearch.common.xcontent.XContentType) InjectSecurity(org.opensearch.commons.InjectSecurity) Scheduler(org.opensearch.threadpool.Scheduler) GetSettingsAction(org.opensearch.action.admin.indices.settings.get.GetSettingsAction) DiscoveryNodeFilterer(org.opensearch.ad.util.DiscoveryNodeFilterer) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ThreadPool(org.opensearch.threadpool.ThreadPool) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) IndicesOptions(org.opensearch.action.support.IndicesOptions) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) ArrayList(java.util.ArrayList) GetSettingsRequest(org.opensearch.action.admin.indices.settings.get.GetSettingsRequest) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) DeleteIndexRequest(org.opensearch.action.admin.indices.delete.DeleteIndexRequest) ANOMALY_DETECTOR_JOBS_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_DETECTOR_JOBS_INDEX_MAPPING_FILE) AnomalyDetector(org.opensearch.ad.model.AnomalyDetector) EndRunException(org.opensearch.ad.common.exception.EndRunException) Charsets(com.google.common.base.Charsets) CommonName(org.opensearch.ad.constant.CommonName) Iterator(java.util.Iterator) CommonValue(org.opensearch.ad.constant.CommonValue) Resources(com.google.common.io.Resources) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) IOException(java.io.IOException) CreateIndexResponse(org.opensearch.action.admin.indices.create.CreateIndexResponse) GetAliasesRequest(org.opensearch.action.admin.indices.alias.get.GetAliasesRequest) GetSettingsResponse(org.opensearch.action.admin.indices.settings.get.GetSettingsResponse) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder) XContentHelper(org.opensearch.common.xcontent.XContentHelper) ClusterStateRequest(org.opensearch.action.admin.cluster.state.ClusterStateRequest) CommonErrorMessages(org.opensearch.ad.constant.CommonErrorMessages) AD_RESULT_HISTORY_ROLLOVER_PERIOD(org.opensearch.ad.settings.AnomalyDetectorSettings.AD_RESULT_HISTORY_ROLLOVER_PERIOD) AD_RESULT_HISTORY_RETENTION_PERIOD(org.opensearch.ad.settings.AnomalyDetectorSettings.AD_RESULT_HISTORY_RETENTION_PERIOD) AnomalyDetectorJob(org.opensearch.ad.model.AnomalyDetectorJob) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) ClusterService(org.opensearch.cluster.service.ClusterService) IndexRequest(org.opensearch.action.index.IndexRequest) LogManager(org.apache.logging.log4j.LogManager) CAN_NOT_FIND_RESULT_INDEX(org.opensearch.ad.constant.CommonErrorMessages.CAN_NOT_FIND_RESULT_INDEX) DeleteIndexRequest(org.opensearch.action.admin.indices.delete.DeleteIndexRequest) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage)

Example 35 with IndexNotFoundException

use of org.opensearch.index.IndexNotFoundException in project anomaly-detection by opensearch-project.

the class AnomalyDetectionIndices method updateJobIndexSettingIfNecessary.

private void updateJobIndexSettingIfNecessary(IndexState jobIndexState, ActionListener<Void> listener) {
    GetSettingsRequest getSettingsRequest = new GetSettingsRequest().indices(ADIndex.JOB.getIndexName()).names(new String[] { IndexMetadata.SETTING_NUMBER_OF_SHARDS, IndexMetadata.SETTING_NUMBER_OF_REPLICAS, IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS });
    client.execute(GetSettingsAction.INSTANCE, getSettingsRequest, ActionListener.wrap(settingResponse -> {
        // auto expand setting is a range string like "1-all"
        String autoExpandReplica = getStringSetting(settingResponse, IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS);
        // if the auto expand setting is already there, return immediately
        if (autoExpandReplica != null) {
            jobIndexState.settingUpToDate = true;
            logger.info(new ParameterizedMessage("Mark [{}]'s mapping up-to-date", ADIndex.JOB.getIndexName()));
            listener.onResponse(null);
            return;
        }
        Integer primaryShardsNumber = getIntegerSetting(settingResponse, IndexMetadata.SETTING_NUMBER_OF_SHARDS);
        Integer replicaNumber = getIntegerSetting(settingResponse, IndexMetadata.SETTING_NUMBER_OF_REPLICAS);
        if (primaryShardsNumber == null || replicaNumber == null) {
            logger.error(new ParameterizedMessage("Fail to find AD job index's primary or replica shard number: primary [{}], replica [{}]", primaryShardsNumber, replicaNumber));
            // don't throw exception as we don't know how to handle it and retry next time
            listener.onResponse(null);
            return;
        }
        // at least minJobIndexReplicas
        // at most maxJobIndexReplicas / primaryShardsNumber replicas.
        // For example, if we have 2 primary shards, since the max number of shards are maxJobIndexReplicas (20),
        // we will use 20 / 2 = 10 replicas as the upper bound of replica.
        int maxExpectedReplicas = Math.max(maxJobIndexReplicas / primaryShardsNumber, minJobIndexReplicas);
        Settings updatedSettings = Settings.builder().put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, minJobIndexReplicas + "-" + maxExpectedReplicas).build();
        final UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(ADIndex.JOB.getIndexName()).settings(updatedSettings);
        client.admin().indices().updateSettings(updateSettingsRequest, ActionListener.wrap(response -> {
            jobIndexState.settingUpToDate = true;
            logger.info(new ParameterizedMessage("Mark [{}]'s mapping up-to-date", ADIndex.JOB.getIndexName()));
            listener.onResponse(null);
        }, listener::onFailure));
    }, e -> {
        if (e instanceof IndexNotFoundException) {
            // new index will be created with auto expand replica setting
            jobIndexState.settingUpToDate = true;
            logger.info(new ParameterizedMessage("Mark [{}]'s mapping up-to-date", ADIndex.JOB.getIndexName()));
            listener.onResponse(null);
        } else {
            listener.onFailure(e);
        }
    }));
}
Also used : DUMMY_AD_RESULT_ID(org.opensearch.ad.constant.CommonName.DUMMY_AD_RESULT_ID) Arrays(java.util.Arrays) UpdateSettingsRequest(org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest) URL(java.net.URL) ToXContent(org.opensearch.common.xcontent.ToXContent) Strings(org.opensearch.common.Strings) ANOMALY_RESULTS_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_RESULTS_INDEX_MAPPING_FILE) CHECKPOINT_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.CHECKPOINT_INDEX_MAPPING_FILE) AnomalyDetectorFunction(org.opensearch.ad.rest.handler.AnomalyDetectorFunction) XContentParser(org.opensearch.common.xcontent.XContentParser) GroupedActionListener(org.opensearch.action.support.GroupedActionListener) ObjectObjectCursor(com.carrotsearch.hppc.cursors.ObjectObjectCursor) Alias(org.opensearch.action.admin.indices.alias.Alias) Token(org.opensearch.common.xcontent.XContentParser.Token) Map(java.util.Map) ANOMALY_DETECTION_STATE_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_DETECTION_STATE_INDEX_MAPPING_FILE) ActionListener(org.opensearch.action.ActionListener) MAX_PRIMARY_SHARDS(org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_PRIMARY_SHARDS) CreateIndexRequest(org.opensearch.action.admin.indices.create.CreateIndexRequest) DeleteRequest(org.opensearch.action.delete.DeleteRequest) RolloverRequest(org.opensearch.action.admin.indices.rollover.RolloverRequest) ANOMALY_DETECTORS_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_DETECTORS_INDEX_MAPPING_FILE) Client(org.opensearch.client.Client) TimeValue(org.opensearch.common.unit.TimeValue) AD_RESULT_HISTORY_MAX_DOCS_PER_SHARD(org.opensearch.ad.settings.AnomalyDetectorSettings.AD_RESULT_HISTORY_MAX_DOCS_PER_SHARD) EnumMap(java.util.EnumMap) AdminClient(org.opensearch.client.AdminClient) PutMappingRequest(org.opensearch.action.admin.indices.mapping.put.PutMappingRequest) LocalNodeMasterListener(org.opensearch.cluster.LocalNodeMasterListener) LoggingDeprecationHandler(org.opensearch.common.xcontent.LoggingDeprecationHandler) Set(java.util.Set) ExceptionsHelper(org.opensearch.ExceptionsHelper) Settings(org.opensearch.common.settings.Settings) Instant(java.time.Instant) ObjectCursor(com.carrotsearch.hppc.cursors.ObjectCursor) List(java.util.List) Logger(org.apache.logging.log4j.Logger) AnomalyResult(org.opensearch.ad.model.AnomalyResult) BytesArray(org.opensearch.common.bytes.BytesArray) ResourceAlreadyExistsException(org.opensearch.ResourceAlreadyExistsException) XContentType(org.opensearch.common.xcontent.XContentType) InjectSecurity(org.opensearch.commons.InjectSecurity) Scheduler(org.opensearch.threadpool.Scheduler) GetSettingsAction(org.opensearch.action.admin.indices.settings.get.GetSettingsAction) DiscoveryNodeFilterer(org.opensearch.ad.util.DiscoveryNodeFilterer) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ThreadPool(org.opensearch.threadpool.ThreadPool) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) IndicesOptions(org.opensearch.action.support.IndicesOptions) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) ArrayList(java.util.ArrayList) GetSettingsRequest(org.opensearch.action.admin.indices.settings.get.GetSettingsRequest) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) DeleteIndexRequest(org.opensearch.action.admin.indices.delete.DeleteIndexRequest) ANOMALY_DETECTOR_JOBS_INDEX_MAPPING_FILE(org.opensearch.ad.settings.AnomalyDetectorSettings.ANOMALY_DETECTOR_JOBS_INDEX_MAPPING_FILE) AnomalyDetector(org.opensearch.ad.model.AnomalyDetector) EndRunException(org.opensearch.ad.common.exception.EndRunException) Charsets(com.google.common.base.Charsets) CommonName(org.opensearch.ad.constant.CommonName) Iterator(java.util.Iterator) CommonValue(org.opensearch.ad.constant.CommonValue) Resources(com.google.common.io.Resources) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) IOException(java.io.IOException) CreateIndexResponse(org.opensearch.action.admin.indices.create.CreateIndexResponse) GetAliasesRequest(org.opensearch.action.admin.indices.alias.get.GetAliasesRequest) GetSettingsResponse(org.opensearch.action.admin.indices.settings.get.GetSettingsResponse) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder) XContentHelper(org.opensearch.common.xcontent.XContentHelper) ClusterStateRequest(org.opensearch.action.admin.cluster.state.ClusterStateRequest) CommonErrorMessages(org.opensearch.ad.constant.CommonErrorMessages) AD_RESULT_HISTORY_ROLLOVER_PERIOD(org.opensearch.ad.settings.AnomalyDetectorSettings.AD_RESULT_HISTORY_ROLLOVER_PERIOD) AD_RESULT_HISTORY_RETENTION_PERIOD(org.opensearch.ad.settings.AnomalyDetectorSettings.AD_RESULT_HISTORY_RETENTION_PERIOD) AnomalyDetectorJob(org.opensearch.ad.model.AnomalyDetectorJob) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) ClusterService(org.opensearch.cluster.service.ClusterService) IndexRequest(org.opensearch.action.index.IndexRequest) LogManager(org.apache.logging.log4j.LogManager) CAN_NOT_FIND_RESULT_INDEX(org.opensearch.ad.constant.CommonErrorMessages.CAN_NOT_FIND_RESULT_INDEX) GetSettingsRequest(org.opensearch.action.admin.indices.settings.get.GetSettingsRequest) UpdateSettingsRequest(org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) Settings(org.opensearch.common.settings.Settings)

Aggregations

IndexNotFoundException (org.opensearch.index.IndexNotFoundException)107 ActionListener (org.opensearch.action.ActionListener)32 ClusterState (org.opensearch.cluster.ClusterState)26 IOException (java.io.IOException)25 ThreadContext (org.opensearch.common.util.concurrent.ThreadContext)25 Map (java.util.Map)23 Client (org.opensearch.client.Client)23 ArrayList (java.util.ArrayList)21 Settings (org.opensearch.common.settings.Settings)21 Logger (org.apache.logging.log4j.Logger)20 List (java.util.List)19 LogManager (org.apache.logging.log4j.LogManager)19 SearchResponse (org.opensearch.action.search.SearchResponse)19 HashMap (java.util.HashMap)18 GetRequest (org.opensearch.action.get.GetRequest)18 AnomalyDetector (org.opensearch.ad.model.AnomalyDetector)18 NamedXContentRegistry (org.opensearch.common.xcontent.NamedXContentRegistry)18 ClusterService (org.opensearch.cluster.service.ClusterService)17 XContentParser (org.opensearch.common.xcontent.XContentParser)17 DeleteResponse (org.opensearch.action.delete.DeleteResponse)16