Search in sources :

Example 6 with AnomalyResult

use of org.opensearch.ad.model.AnomalyResult in project anomaly-detection by opensearch-project.

the class MultiEntityProfileRunnerTests method setUpClientSearch.

@SuppressWarnings("unchecked")
private void setUpClientSearch(InittedEverResultStatus inittedEverResultStatus) {
    doAnswer(invocation -> {
        Object[] args = invocation.getArguments();
        SearchRequest request = (SearchRequest) args[0];
        ActionListener<SearchResponse> listener = (ActionListener<SearchResponse>) args[1];
        AnomalyResult result = null;
        if (request.source().query().toString().contains(AnomalyResult.ANOMALY_SCORE_FIELD)) {
            switch(inittedEverResultStatus) {
                case INITTED:
                    result = TestHelpers.randomAnomalyDetectResult(0.87);
                    listener.onResponse(TestHelpers.createSearchResponse(result));
                    break;
                case NOT_INITTED:
                    listener.onResponse(TestHelpers.createEmptySearchResponse());
                    break;
                default:
                    assertTrue("should not reach here", false);
                    break;
            }
        }
        return null;
    }).when(client).search(any(), any());
}
Also used : SearchRequest(org.opensearch.action.search.SearchRequest) ActionListener(org.opensearch.action.ActionListener) AnomalyResult(org.opensearch.ad.model.AnomalyResult) SearchResponse(org.opensearch.action.search.SearchResponse)

Example 7 with AnomalyResult

use of org.opensearch.ad.model.AnomalyResult in project anomaly-detection by opensearch-project.

the class TestHelpers method randomHCADAnomalyDetectResult.

public static AnomalyResult randomHCADAnomalyDetectResult(String detectorId, String taskId, Map<String, Object> entityAttrs, double score, double grade, String error, Long startTimeEpochMillis, Long endTimeEpochMillis) {
    List<DataByFeatureId> relavantAttribution = new ArrayList<DataByFeatureId>();
    relavantAttribution.add(new DataByFeatureId(randomAlphaOfLength(5), randomDoubleBetween(0, 1.0, true)));
    relavantAttribution.add(new DataByFeatureId(randomAlphaOfLength(5), randomDoubleBetween(0, 1.0, true)));
    List<DataByFeatureId> pastValues = new ArrayList<DataByFeatureId>();
    pastValues.add(new DataByFeatureId(randomAlphaOfLength(5), randomDouble()));
    pastValues.add(new DataByFeatureId(randomAlphaOfLength(5), randomDouble()));
    List<ExpectedValueList> expectedValuesList = new ArrayList<ExpectedValueList>();
    List<DataByFeatureId> expectedValues = new ArrayList<DataByFeatureId>();
    expectedValues.add(new DataByFeatureId(randomAlphaOfLength(5), randomDouble()));
    expectedValues.add(new DataByFeatureId(randomAlphaOfLength(5), randomDouble()));
    expectedValuesList.add(new ExpectedValueList(randomDoubleBetween(0, 1.0, true), expectedValues));
    return new AnomalyResult(detectorId == null ? randomAlphaOfLength(5) : detectorId, taskId, score, grade, randomDouble(), ImmutableList.of(randomFeatureData(), randomFeatureData()), startTimeEpochMillis == null ? Instant.now().truncatedTo(ChronoUnit.SECONDS) : Instant.ofEpochMilli(startTimeEpochMillis), endTimeEpochMillis == null ? Instant.now().truncatedTo(ChronoUnit.SECONDS) : Instant.ofEpochMilli(endTimeEpochMillis), startTimeEpochMillis == null ? Instant.now().truncatedTo(ChronoUnit.SECONDS) : Instant.ofEpochMilli(startTimeEpochMillis), endTimeEpochMillis == null ? Instant.now().truncatedTo(ChronoUnit.SECONDS) : Instant.ofEpochMilli(endTimeEpochMillis), error, entityAttrs == null ? Entity.createSingleAttributeEntity(randomAlphaOfLength(5), randomAlphaOfLength(5)) : Entity.createEntityByReordering(entityAttrs), randomUser(), CommonValue.NO_SCHEMA_VERSION, null, Instant.now().truncatedTo(ChronoUnit.SECONDS), relavantAttribution, pastValues, expectedValuesList, randomDoubleBetween(1.1, 10.0, true));
}
Also used : ExpectedValueList(org.opensearch.ad.model.ExpectedValueList) ArrayList(java.util.ArrayList) AnomalyResult(org.opensearch.ad.model.AnomalyResult) DataByFeatureId(org.opensearch.ad.model.DataByFeatureId)

Example 8 with AnomalyResult

use of org.opensearch.ad.model.AnomalyResult in project anomaly-detection by opensearch-project.

the class AnomalyResultBulkIndexHandler method bulkSaveDetectorResult.

private void bulkSaveDetectorResult(String resultIndex, List<AnomalyResult> anomalyResults, ActionListener<BulkResponse> listener) {
    BulkRequestBuilder bulkRequestBuilder = client.prepareBulk();
    anomalyResults.forEach(anomalyResult -> {
        try (XContentBuilder builder = jsonBuilder()) {
            IndexRequest indexRequest = new IndexRequest(resultIndex).source(anomalyResult.toXContent(builder, RestHandlerUtils.XCONTENT_WITH_TYPE));
            bulkRequestBuilder.add(indexRequest);
        } catch (Exception e) {
            String error = "Failed to prepare request to bulk index anomaly results";
            LOG.error(error, e);
            throw new AnomalyDetectionException(error);
        }
    });
    client.bulk(bulkRequestBuilder.request(), ActionListener.wrap(r -> {
        if (r.hasFailures()) {
            String failureMessage = r.buildFailureMessage();
            LOG.warn("Failed to bulk index AD result " + failureMessage);
            listener.onFailure(new AnomalyDetectionException(failureMessage));
        } else {
            listener.onResponse(r);
        }
    }, e -> {
        LOG.error("bulk index ad result failed", e);
        listener.onFailure(e);
    }));
}
Also used : AnomalyDetectionException(org.opensearch.ad.common.exception.AnomalyDetectionException) XContentFactory.jsonBuilder(org.opensearch.common.xcontent.XContentFactory.jsonBuilder) Client(org.opensearch.client.Client) ClientUtil(org.opensearch.ad.util.ClientUtil) ThreadPool(org.opensearch.threadpool.ThreadPool) ExceptionsHelper(org.opensearch.ExceptionsHelper) AnomalyDetectionIndices(org.opensearch.ad.indices.AnomalyDetectionIndices) Settings(org.opensearch.common.settings.Settings) BulkRequestBuilder(org.opensearch.action.bulk.BulkRequestBuilder) AnomalyDetectionException(org.opensearch.ad.common.exception.AnomalyDetectionException) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder) List(java.util.List) Logger(org.apache.logging.log4j.Logger) AnomalyResult(org.opensearch.ad.model.AnomalyResult) BulkResponse(org.opensearch.action.bulk.BulkResponse) ClusterService(org.opensearch.cluster.service.ClusterService) ResourceAlreadyExistsException(org.opensearch.ResourceAlreadyExistsException) ActionListener(org.opensearch.action.ActionListener) IndexUtils(org.opensearch.ad.util.IndexUtils) IndexRequest(org.opensearch.action.index.IndexRequest) LogManager(org.apache.logging.log4j.LogManager) EndRunException(org.opensearch.ad.common.exception.EndRunException) CAN_NOT_FIND_RESULT_INDEX(org.opensearch.ad.constant.CommonErrorMessages.CAN_NOT_FIND_RESULT_INDEX) ANOMALY_RESULT_INDEX_ALIAS(org.opensearch.ad.constant.CommonName.ANOMALY_RESULT_INDEX_ALIAS) RestHandlerUtils(org.opensearch.ad.util.RestHandlerUtils) BulkRequestBuilder(org.opensearch.action.bulk.BulkRequestBuilder) IndexRequest(org.opensearch.action.index.IndexRequest) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder) AnomalyDetectionException(org.opensearch.ad.common.exception.AnomalyDetectionException) ResourceAlreadyExistsException(org.opensearch.ResourceAlreadyExistsException) EndRunException(org.opensearch.ad.common.exception.EndRunException)

Example 9 with AnomalyResult

use of org.opensearch.ad.model.AnomalyResult in project anomaly-detection by opensearch-project.

the class ADBatchTaskRunner method storeAnomalyResultAndRunNextPiece.

private void storeAnomalyResultAndRunNextPiece(ADTask adTask, long pieceEndTime, long dataStartTime, long dataEndTime, long interval, ActionListener<String> internalListener, List<AnomalyResult> anomalyResults, String resultIndex, CheckedRunnable<?> runBefore) {
    ActionListener actionListener = new ThreadedActionListener<>(logger, threadPool, AD_BATCH_TASK_THREAD_POOL_NAME, ActionListener.wrap(r -> {
        try {
            runNextPiece(adTask, pieceEndTime, dataStartTime, dataEndTime, interval, internalListener);
        } catch (Exception e) {
            internalListener.onFailure(e);
        }
    }, e -> {
        logger.error("Fail to bulk index anomaly result", e);
        internalListener.onFailure(e);
    }), false);
    anomalyResultBulkIndexHandler.bulkIndexAnomalyResult(resultIndex, anomalyResults, runBefore == null ? actionListener : ActionListener.runBefore(actionListener, runBefore));
}
Also used : AnomalyResultBulkIndexHandler(org.opensearch.ad.transport.handler.AnomalyResultBulkIndexHandler) ModelManager(org.opensearch.ad.ml.ModelManager) HashRing(org.opensearch.ad.cluster.HashRing) LimitExceededException(org.opensearch.ad.common.exception.LimitExceededException) ADTaskState(org.opensearch.ad.model.ADTaskState) AnomalyDetectorFunction(org.opensearch.ad.rest.handler.AnomalyDetectorFunction) ADIndex(org.opensearch.ad.indices.ADIndex) Map(java.util.Map) ActionListener(org.opensearch.action.ActionListener) BATCH_TASK_PIECE_SIZE(org.opensearch.ad.settings.AnomalyDetectorSettings.BATCH_TASK_PIECE_SIZE) ADStatsNodeResponse(org.opensearch.ad.transport.ADStatsNodeResponse) MAX_RUNNING_ENTITIES_PER_DETECTOR_FOR_HISTORICAL_ANALYSIS(org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_RUNNING_ENTITIES_PER_DETECTOR_FOR_HISTORICAL_ANALYSIS) Client(org.opensearch.client.Client) AD_BATCH_TASK_THREAD_POOL_NAME(org.opensearch.ad.AnomalyDetectorPlugin.AD_BATCH_TASK_THREAD_POOL_NAME) TimeValue(org.opensearch.common.unit.TimeValue) TransportRequestOptions(org.opensearch.transport.TransportRequestOptions) Settings(org.opensearch.common.settings.Settings) NO_ELIGIBLE_NODE_TO_RUN_DETECTOR(org.opensearch.ad.constant.CommonErrorMessages.NO_ELIGIBLE_NODE_TO_RUN_DETECTOR) TransportService(org.opensearch.transport.TransportService) RandomCutForest(com.amazon.randomcutforest.RandomCutForest) Logger(org.apache.logging.log4j.Logger) PriorityTracker(org.opensearch.ad.caching.PriorityTracker) ExceptionUtil(org.opensearch.ad.util.ExceptionUtil) ActionListenerResponseHandler(org.opensearch.action.ActionListenerResponseHandler) SearchFeatureDao(org.opensearch.ad.feature.SearchFeatureDao) CheckedRunnable(org.opensearch.common.CheckedRunnable) EXECUTION_END_TIME_FIELD(org.opensearch.ad.model.ADTask.EXECUTION_END_TIME_FIELD) InjectSecurity(org.opensearch.commons.InjectSecurity) BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder) BATCH_TASK_PIECE_INTERVAL_SECONDS(org.opensearch.ad.settings.AnomalyDetectorSettings.BATCH_TASK_PIECE_INTERVAL_SECONDS) ADCircuitBreakerService(org.opensearch.ad.breaker.ADCircuitBreakerService) MAX_BATCH_TASK_PER_NODE(org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_BATCH_TASK_PER_NODE) StringTerms(org.opensearch.search.aggregations.bucket.terms.StringTerms) ThreadPool(org.opensearch.threadpool.ThreadPool) EnabledSetting(org.opensearch.ad.settings.EnabledSetting) AnomalyDetectorSettings(org.opensearch.ad.settings.AnomalyDetectorSettings) ArrayList(java.util.ArrayList) AnomalyDetector(org.opensearch.ad.model.AnomalyDetector) BiConsumer(java.util.function.BiConsumer) SearchRequest(org.opensearch.action.search.SearchRequest) INIT_PROGRESS_FIELD(org.opensearch.ad.model.ADTask.INIT_PROGRESS_FIELD) SinglePointFeatures(org.opensearch.ad.feature.SinglePointFeatures) FeatureManager(org.opensearch.ad.feature.FeatureManager) MAX_TOP_ENTITIES_FOR_HISTORICAL_ANALYSIS(org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_TOP_ENTITIES_FOR_HISTORICAL_ANALYSIS) ADStatsNodesAction(org.opensearch.ad.transport.ADStatsNodesAction) AggregationBuilders(org.opensearch.search.aggregations.AggregationBuilders) CommonErrorMessages(org.opensearch.ad.constant.CommonErrorMessages) ClusterService(org.opensearch.cluster.service.ClusterService) StatNames(org.opensearch.ad.stats.StatNames) ParseUtils(org.opensearch.ad.util.ParseUtils) InternalMin(org.opensearch.search.aggregations.metrics.InternalMin) AD_EXECUTING_BATCH_TASK_COUNT(org.opensearch.ad.stats.StatNames.AD_EXECUTING_BATCH_TASK_COUNT) ResourceNotFoundException(org.opensearch.ad.common.exception.ResourceNotFoundException) ADStats(org.opensearch.ad.stats.ADStats) ParseUtils.isNullOrEmpty(org.opensearch.ad.util.ParseUtils.isNullOrEmpty) ADTaskCancelledException(org.opensearch.ad.common.exception.ADTaskCancelledException) ADStatsRequest(org.opensearch.ad.transport.ADStatsRequest) AnomalyDetectionException(org.opensearch.ad.common.exception.AnomalyDetectionException) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) AggregationBuilder(org.opensearch.search.aggregations.AggregationBuilder) InternalMax(org.opensearch.search.aggregations.metrics.InternalMax) TASK_PROGRESS_FIELD(org.opensearch.ad.model.ADTask.TASK_PROGRESS_FIELD) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) ADBatchTaskRemoteExecutionAction(org.opensearch.ad.transport.ADBatchTaskRemoteExecutionAction) ADTaskType(org.opensearch.ad.model.ADTaskType) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) List(java.util.List) AnomalyResult(org.opensearch.ad.model.AnomalyResult) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder) DEFAULT_JVM_HEAP_USAGE_THRESHOLD(org.opensearch.ad.breaker.MemoryCircuitBreaker.DEFAULT_JVM_HEAP_USAGE_THRESHOLD) DetectionDateRange(org.opensearch.ad.model.DetectionDateRange) NUM_MIN_SAMPLES(org.opensearch.ad.settings.AnomalyDetectorSettings.NUM_MIN_SAMPLES) Optional(java.util.Optional) AnomalyDescriptor(com.amazon.randomcutforest.parkservices.AnomalyDescriptor) ADTask(org.opensearch.ad.model.ADTask) FeatureData(org.opensearch.ad.model.FeatureData) HashMap(java.util.HashMap) Deque(java.util.Deque) ThreadedActionListener(org.opensearch.action.support.ThreadedActionListener) CURRENT_PIECE_FIELD(org.opensearch.ad.model.ADTask.CURRENT_PIECE_FIELD) ImmutableList(com.google.common.collect.ImmutableList) ADBatchAnomalyResultResponse(org.opensearch.ad.transport.ADBatchAnomalyResultResponse) JVM_HEAP_USAGE(org.opensearch.ad.stats.InternalStatNames.JVM_HEAP_USAGE) EndRunException(org.opensearch.ad.common.exception.EndRunException) ADBatchAnomalyResultRequest(org.opensearch.ad.transport.ADBatchAnomalyResultRequest) AGG_NAME_MAX_TIME(org.opensearch.ad.constant.CommonName.AGG_NAME_MAX_TIME) RangeQueryBuilder(org.opensearch.index.query.RangeQueryBuilder) MAX_TOP_ENTITIES_LIMIT_FOR_HISTORICAL_ANALYSIS(org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_TOP_ENTITIES_LIMIT_FOR_HISTORICAL_ANALYSIS) TermQueryBuilder(org.opensearch.index.query.TermQueryBuilder) AnomalyDetectionIndices(org.opensearch.ad.indices.AnomalyDetectionIndices) STATE_FIELD(org.opensearch.ad.model.ADTask.STATE_FIELD) WORKER_NODE_FIELD(org.opensearch.ad.model.ADTask.WORKER_NODE_FIELD) Entity(org.opensearch.ad.model.Entity) TermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder) ThresholdedRandomCutForest(com.amazon.randomcutforest.parkservices.ThresholdedRandomCutForest) Clock(java.time.Clock) IntervalTimeConfiguration(org.opensearch.ad.model.IntervalTimeConfiguration) LogManager(org.apache.logging.log4j.LogManager) AGG_NAME_MIN_TIME(org.opensearch.ad.constant.CommonName.AGG_NAME_MIN_TIME) ThreadedActionListener(org.opensearch.action.support.ThreadedActionListener) ActionListener(org.opensearch.action.ActionListener) ThreadedActionListener(org.opensearch.action.support.ThreadedActionListener) LimitExceededException(org.opensearch.ad.common.exception.LimitExceededException) ResourceNotFoundException(org.opensearch.ad.common.exception.ResourceNotFoundException) ADTaskCancelledException(org.opensearch.ad.common.exception.ADTaskCancelledException) AnomalyDetectionException(org.opensearch.ad.common.exception.AnomalyDetectionException) EndRunException(org.opensearch.ad.common.exception.EndRunException)

Example 10 with AnomalyResult

use of org.opensearch.ad.model.AnomalyResult in project anomaly-detection by opensearch-project.

the class ADBatchTaskRunner method detectAnomaly.

private void detectAnomaly(ADTask adTask, Map<Long, Optional<double[]>> dataPoints, long pieceStartTime, long pieceEndTime, long dataStartTime, long dataEndTime, long interval, Instant executeStartTime, ActionListener<String> internalListener) {
    String taskId = adTask.getTaskId();
    ThresholdedRandomCutForest trcf = adTaskCacheManager.getTRcfModel(taskId);
    Deque<Map.Entry<Long, Optional<double[]>>> shingle = adTaskCacheManager.getShingle(taskId);
    List<AnomalyResult> anomalyResults = new ArrayList<>();
    long intervalEndTime = pieceStartTime;
    for (int i = 0; i < pieceSize && intervalEndTime < dataEndTime; i++) {
        Optional<double[]> dataPoint = dataPoints.containsKey(intervalEndTime) ? dataPoints.get(intervalEndTime) : Optional.empty();
        intervalEndTime = intervalEndTime + interval;
        SinglePointFeatures feature = featureManager.getShingledFeatureForHistoricalAnalysis(adTask.getDetector(), shingle, dataPoint, intervalEndTime);
        List<FeatureData> featureData = null;
        if (feature.getUnprocessedFeatures().isPresent()) {
            featureData = ParseUtils.getFeatureData(feature.getUnprocessedFeatures().get(), adTask.getDetector());
        }
        if (!feature.getProcessedFeatures().isPresent()) {
            String error = feature.getUnprocessedFeatures().isPresent() ? "No full shingle in current detection window" : "No data in current detection window";
            AnomalyResult anomalyResult = new AnomalyResult(adTask.getDetectorId(), adTask.getDetectorLevelTaskId(), featureData, Instant.ofEpochMilli(intervalEndTime - interval), Instant.ofEpochMilli(intervalEndTime), executeStartTime, Instant.now(), error, adTask.getEntity(), adTask.getDetector().getUser(), anomalyDetectionIndices.getSchemaVersion(ADIndex.RESULT), adTask.getEntityModelId());
            anomalyResults.add(anomalyResult);
        } else {
            double[] point = feature.getProcessedFeatures().get();
            // 0 is placeholder for timestamp. In the future, we will add
            // data time stamp there.
            AnomalyDescriptor descriptor = trcf.process(point, 0);
            double score = descriptor.getRCFScore();
            if (!adTaskCacheManager.isThresholdModelTrained(taskId) && score > 0) {
                adTaskCacheManager.setThresholdModelTrained(taskId, true);
            }
            AnomalyResult anomalyResult = AnomalyResult.fromRawTRCFResult(adTask.getDetectorId(), adTask.getDetector().getDetectorIntervalInMilliseconds(), adTask.getDetectorLevelTaskId(), score, descriptor.getAnomalyGrade(), descriptor.getDataConfidence(), featureData, Instant.ofEpochMilli(intervalEndTime - interval), Instant.ofEpochMilli(intervalEndTime), executeStartTime, Instant.now(), null, adTask.getEntity(), adTask.getDetector().getUser(), anomalyDetectionIndices.getSchemaVersion(ADIndex.RESULT), adTask.getEntityModelId(), modelManager.normalizeAttribution(trcf.getForest(), descriptor.getRelevantAttribution()), descriptor.getRelativeIndex(), descriptor.getPastValues(), descriptor.getExpectedValuesList(), descriptor.getLikelihoodOfValues(), descriptor.getThreshold());
            anomalyResults.add(anomalyResult);
        }
    }
    String user;
    List<String> roles;
    if (adTask.getUser() == null) {
        // It's possible that user create domain with security disabled, then enable security
        // after upgrading. This is for BWC, for old detectors which created when security
        // disabled, the user will be null.
        user = "";
        roles = settings.getAsList("", ImmutableList.of("all_access", "AmazonES_all_access"));
    } else {
        user = adTask.getUser().getName();
        roles = adTask.getUser().getRoles();
    }
    String resultIndex = adTask.getDetector().getResultIndex();
    if (resultIndex == null) {
        // if result index is null, store anomaly result directly
        storeAnomalyResultAndRunNextPiece(adTask, pieceEndTime, dataStartTime, dataEndTime, interval, internalListener, anomalyResults, resultIndex, null);
        return;
    }
    try (InjectSecurity injectSecurity = new InjectSecurity(adTask.getTaskId(), settings, client.threadPool().getThreadContext())) {
        // Injecting user role to verify if the user has permissions to write result to result index.
        injectSecurity.inject(user, roles);
        storeAnomalyResultAndRunNextPiece(adTask, pieceEndTime, dataStartTime, dataEndTime, interval, internalListener, anomalyResults, resultIndex, () -> injectSecurity.close());
    } catch (Exception exception) {
        logger.error("Failed to inject user roles", exception);
        internalListener.onFailure(exception);
    }
}
Also used : ArrayList(java.util.ArrayList) FeatureData(org.opensearch.ad.model.FeatureData) LimitExceededException(org.opensearch.ad.common.exception.LimitExceededException) ResourceNotFoundException(org.opensearch.ad.common.exception.ResourceNotFoundException) ADTaskCancelledException(org.opensearch.ad.common.exception.ADTaskCancelledException) AnomalyDetectionException(org.opensearch.ad.common.exception.AnomalyDetectionException) EndRunException(org.opensearch.ad.common.exception.EndRunException) SinglePointFeatures(org.opensearch.ad.feature.SinglePointFeatures) AnomalyDescriptor(com.amazon.randomcutforest.parkservices.AnomalyDescriptor) AnomalyResult(org.opensearch.ad.model.AnomalyResult) InjectSecurity(org.opensearch.commons.InjectSecurity) ThresholdedRandomCutForest(com.amazon.randomcutforest.parkservices.ThresholdedRandomCutForest)

Aggregations

AnomalyResult (org.opensearch.ad.model.AnomalyResult)26 ArrayList (java.util.ArrayList)10 AnomalyDetector (org.opensearch.ad.model.AnomalyDetector)10 IOException (java.io.IOException)9 List (java.util.List)9 ActionListener (org.opensearch.action.ActionListener)8 EndRunException (org.opensearch.ad.common.exception.EndRunException)7 Instant (java.time.Instant)6 IndexRequest (org.opensearch.action.index.IndexRequest)6 Map (java.util.Map)5 LogManager (org.apache.logging.log4j.LogManager)5 Logger (org.apache.logging.log4j.Logger)5 AnomalyDetectionException (org.opensearch.ad.common.exception.AnomalyDetectionException)5 FeatureData (org.opensearch.ad.model.FeatureData)5 Settings (org.opensearch.common.settings.Settings)5 XContentBuilder (org.opensearch.common.xcontent.XContentBuilder)5 Test (org.junit.Test)4 Client (org.opensearch.client.Client)4 ClusterService (org.opensearch.cluster.service.ClusterService)4 ThreadPool (org.opensearch.threadpool.ThreadPool)4