Module org.elasticsearch.xcore
Class DatafeedConfigUtils
java.lang.Object
org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfigUtils
Utility methods used for datafeed configuration.
-
Method Summary
Modifier and TypeMethodDescriptiongetDateHistogramValuesSource(CompositeAggregationBuilder compositeAggregationBuilder) static AggregationBuildergetHistogramAggregation(Collection<AggregationBuilder> aggregations) Find and return (date) histogram inaggregationsstatic longgetHistogramIntervalMillis(AggregationBuilder histogramAggregation) Get the interval fromhistogramAggregationor throw anIllegalStateExceptionifhistogramAggregationis not aHistogramAggregationBuilderor aDateHistogramAggregationBuilderstatic longFind the (date) histogram inaggFactoryand extract its interval.static booleanisCompositeWithDateHistogramSource(AggregationBuilder aggregationBuilder) static booleanisHistogram(AggregationBuilder aggregationBuilder) static longvalidateAndGetCalendarInterval(String calendarInterval)
-
Method Details
-
getHistogramIntervalMillis
Find the (date) histogram inaggFactoryand extract its interval. Throws if there is no (date) histogram or if the histogram has sibling aggregations.- Parameters:
aggFactory- Aggregations factory- Returns:
- The histogram interval
-
getHistogramAggregation
public static AggregationBuilder getHistogramAggregation(Collection<AggregationBuilder> aggregations) Find and return (date) histogram inaggregations- Parameters:
aggregations- List of aggregations- Returns:
- A
HistogramAggregationBuilderor aDateHistogramAggregationBuilder
-
isHistogram
-
isCompositeWithDateHistogramSource
-
getDateHistogramValuesSource
public static DateHistogramValuesSourceBuilder getDateHistogramValuesSource(CompositeAggregationBuilder compositeAggregationBuilder) -
getHistogramIntervalMillis
Get the interval fromhistogramAggregationor throw anIllegalStateExceptionifhistogramAggregationis not aHistogramAggregationBuilderor aDateHistogramAggregationBuilder- Parameters:
histogramAggregation- Must be aHistogramAggregationBuilderor aDateHistogramAggregationBuilder- Returns:
- The histogram interval
-
validateAndGetCalendarInterval
-