|
12 | 12 | package org.opensearch.ad.feature;
|
13 | 13 |
|
14 | 14 | import static org.apache.commons.math3.linear.MatrixUtils.createRealMatrix;
|
15 |
| -import static org.opensearch.ad.constant.ADCommonName.DATE_HISTOGRAM; |
16 | 15 | import static org.opensearch.ad.settings.AnomalyDetectorSettings.MAX_ENTITIES_FOR_PREVIEW;
|
17 | 16 | import static org.opensearch.ad.settings.AnomalyDetectorSettings.PAGE_SIZE;
|
18 | 17 | import static org.opensearch.ad.settings.AnomalyDetectorSettings.PREVIEW_TIMEOUT_IN_MILLIS;
|
|
40 | 39 | import org.opensearch.action.ActionListener;
|
41 | 40 | import org.opensearch.action.search.SearchRequest;
|
42 | 41 | import org.opensearch.action.search.SearchResponse;
|
43 |
| -import org.opensearch.ad.constant.ADCommonName; |
44 | 42 | import org.opensearch.ad.model.AnomalyDetector;
|
45 |
| -import org.opensearch.ad.model.Entity; |
46 | 43 | import org.opensearch.ad.util.SecurityClientUtil;
|
47 | 44 | import org.opensearch.client.Client;
|
48 | 45 | import org.opensearch.cluster.service.ClusterService;
|
|
69 | 66 | import org.opensearch.search.sort.FieldSortBuilder;
|
70 | 67 | import org.opensearch.search.sort.SortOrder;
|
71 | 68 | import org.opensearch.timeseries.common.exception.TimeSeriesException;
|
| 69 | +import org.opensearch.timeseries.constant.CommonName; |
72 | 70 | import org.opensearch.timeseries.dataprocessor.Imputer;
|
| 71 | +import org.opensearch.timeseries.model.Entity; |
73 | 72 | import org.opensearch.timeseries.model.IntervalTimeConfiguration;
|
74 | 73 | import org.opensearch.timeseries.util.ParseUtils;
|
75 | 74 |
|
@@ -169,7 +168,7 @@ public SearchFeatureDao(
|
169 | 168 | */
|
170 | 169 | public void getLatestDataTime(AnomalyDetector detector, ActionListener<Optional<Long>> listener) {
|
171 | 170 | SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder()
|
172 |
| - .aggregation(AggregationBuilders.max(ADCommonName.AGG_NAME_MAX_TIME).field(detector.getTimeField())) |
| 171 | + .aggregation(AggregationBuilders.max(CommonName.AGG_NAME_MAX_TIME).field(detector.getTimeField())) |
173 | 172 | .size(0);
|
174 | 173 | SearchRequest searchRequest = new SearchRequest().indices(detector.getIndices().toArray(new String[0])).source(searchSourceBuilder);
|
175 | 174 | final ActionListener<SearchResponse> searchResponseListener = ActionListener
|
@@ -569,7 +568,7 @@ private Map<Long, Optional<double[]>> parseBucketAggregationResponse(SearchRespo
|
569 | 568 | List<InternalComposite.InternalBucket> buckets = ((InternalComposite) agg).getBuckets();
|
570 | 569 | buckets.forEach(bucket -> {
|
571 | 570 | Optional<double[]> featureData = parseAggregations(Optional.ofNullable(bucket.getAggregations()), featureIds);
|
572 |
| - dataPoints.put((Long) bucket.getKey().get(DATE_HISTOGRAM), featureData); |
| 571 | + dataPoints.put((Long) bucket.getKey().get(CommonName.DATE_HISTOGRAM), featureData); |
573 | 572 | });
|
574 | 573 | }
|
575 | 574 | return dataPoints;
|
|
0 commit comments