Module org.elasticsearch.xcore
Class DatafeedConfig
java.lang.Object
org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig
- All Implemented Interfaces:
Diffable<DatafeedConfig>,SimpleDiffable<DatafeedConfig>,Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public class DatafeedConfig
extends Object
implements SimpleDiffable<DatafeedConfig>, org.elasticsearch.xcontent.ToXContentObject
Datafeed configuration options. Describes where to proactively pull input
data from.
If a value has not been set it will be null. Object wrappers are
used around integral types and booleans so they can take null
values.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.cluster.SimpleDiffable
SimpleDiffable.CompleteDiff<T extends Diffable<T>>Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final intstatic final intstatic final org.elasticsearch.xcontent.ParseFieldstatic final StringThe field name used to specify document counts in Elasticsearch aggregationsstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ObjectParser<DatafeedConfig.Builder, Void> static final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ObjectParser<DatafeedConfig.Builder, Void> static StringFields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTYFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.elasticsearch.core.TimeValuedefaultFrequency(org.elasticsearch.core.TimeValue bucketSpan, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) Calculates a sensible default frequency for a given bucket span.static StringdocumentId(String datafeedId) The name of datafeed configuration document name from the datafeed ID.booleanThe lists of indices and types are compared for equality but they are not sorted first so this test could fail simply because the indices and types lists are in different orders.getAggDeprecations(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Calls the parser and returns any gathered deprecationsorg.elasticsearch.xpack.core.ml.datafeed.AggProviderorg.elasticsearch.core.TimeValuelonggetHistogramIntervalMillis(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Returns the histogram's interval as epoch millis.getId()getJobId()getParsedAggregations(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Fully parses the semi-parsedMap<String, Object>aggregationsgetParsedQuery(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Get the fully parsed query from the semi-parsed storedMap<String, Object>getQuery()org.elasticsearch.core.TimeValuegetQueryDeprecations(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Calls the parser and returns any gathered deprecationsbooleanbooleanhasCompositeAgg(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Indicates if the datafeed is using composite aggs.inthashCode()Optional<org.elasticsearch.core.Tuple<TransportVersion, String>> toString()org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) static voidvalidateAggregations(AggregatorFactories.Builder aggregations) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diffMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
DEFAULT_SCROLL_SIZE
public static final int DEFAULT_SCROLL_SIZE- See Also:
-
DEFAULT_AGGREGATION_CHUNKING_BUCKETS
public static final int DEFAULT_AGGREGATION_CHUNKING_BUCKETS- See Also:
-
RESULTS_FIELD
public static final org.elasticsearch.xcontent.ParseField RESULTS_FIELD -
TYPE
-
DOC_COUNT
The field name used to specify document counts in Elasticsearch aggregations- See Also:
-
JOB_ID
public static final org.elasticsearch.xcontent.ParseField JOB_ID -
ID
public static final org.elasticsearch.xcontent.ParseField ID -
CONFIG_TYPE
public static final org.elasticsearch.xcontent.ParseField CONFIG_TYPE -
QUERY_DELAY
public static final org.elasticsearch.xcontent.ParseField QUERY_DELAY -
FREQUENCY
public static final org.elasticsearch.xcontent.ParseField FREQUENCY -
INDEXES
public static final org.elasticsearch.xcontent.ParseField INDEXES -
INDICES
public static final org.elasticsearch.xcontent.ParseField INDICES -
QUERY
public static final org.elasticsearch.xcontent.ParseField QUERY -
SCROLL_SIZE
public static final org.elasticsearch.xcontent.ParseField SCROLL_SIZE -
AGGREGATIONS
public static final org.elasticsearch.xcontent.ParseField AGGREGATIONS -
AGGS
public static final org.elasticsearch.xcontent.ParseField AGGS -
SCRIPT_FIELDS
public static final org.elasticsearch.xcontent.ParseField SCRIPT_FIELDS -
CHUNKING_CONFIG
public static final org.elasticsearch.xcontent.ParseField CHUNKING_CONFIG -
HEADERS
public static final org.elasticsearch.xcontent.ParseField HEADERS -
DELAYED_DATA_CHECK_CONFIG
public static final org.elasticsearch.xcontent.ParseField DELAYED_DATA_CHECK_CONFIG -
MAX_EMPTY_SEARCHES
public static final org.elasticsearch.xcontent.ParseField MAX_EMPTY_SEARCHES -
INDICES_OPTIONS
public static final org.elasticsearch.xcontent.ParseField INDICES_OPTIONS -
LENIENT_PARSER
public static final org.elasticsearch.xcontent.ObjectParser<DatafeedConfig.Builder,Void> LENIENT_PARSER -
STRICT_PARSER
public static final org.elasticsearch.xcontent.ObjectParser<DatafeedConfig.Builder,Void> STRICT_PARSER
-
-
Constructor Details
-
DatafeedConfig
- Throws:
IOException
-
-
Method Details
-
validateAggregations
-
documentId
The name of datafeed configuration document name from the datafeed ID.- Parameters:
datafeedId- The datafeed ID- Returns:
- The ID of document the datafeed config is persisted in
-
getId
-
getJobId
-
getConfigType
-
getQueryDelay
public org.elasticsearch.core.TimeValue getQueryDelay() -
getFrequency
public org.elasticsearch.core.TimeValue getFrequency() -
getIndices
-
getScrollSize
-
minRequiredTransportVersion
public Optional<org.elasticsearch.core.Tuple<TransportVersion,String>> minRequiredTransportVersion() -
getParsedQuery
public QueryBuilder getParsedQuery(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Get the fully parsed query from the semi-parsed storedMap<String, Object>- Parameters:
namedXContentRegistry- XContent registry to transform the lazily parsed query- Returns:
- Fully parsed query
-
getQueryDeprecations
public List<String> getQueryDeprecations(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Calls the parser and returns any gathered deprecations- Parameters:
namedXContentRegistry- XContent registry to transform the lazily parsed query- Returns:
- The deprecations from parsing the query
-
getQuery
-
getParsedAggregations
public AggregatorFactories.Builder getParsedAggregations(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Fully parses the semi-parsedMap<String, Object>aggregations- Parameters:
namedXContentRegistry- XContent registry to transform the lazily parsed aggregations- Returns:
- The fully parsed aggregations
-
getAggDeprecations
public List<String> getAggDeprecations(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Calls the parser and returns any gathered deprecations- Parameters:
namedXContentRegistry- XContent registry to transform the lazily parsed aggregations- Returns:
- The deprecations from parsing the aggregations
-
getAggregations
-
getHistogramIntervalMillis
public long getHistogramIntervalMillis(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Returns the histogram's interval as epoch millis.- Parameters:
namedXContentRegistry- XContent registry to transform the lazily parsed aggregations
-
hasCompositeAgg
public boolean hasCompositeAgg(org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry) Indicates if the datafeed is using composite aggs.- Parameters:
namedXContentRegistry- XContent registry to transform the lazily parsed aggregations- Returns:
- If the datafeed utilizes composite aggs or not
-
hasAggregations
public boolean hasAggregations()- Returns:
truewhen there are non-empty aggregations,falseotherwise
-
aggsRewritten
public boolean aggsRewritten() -
getAggProvider
public org.elasticsearch.xpack.core.ml.datafeed.AggProvider getAggProvider() -
getScriptFields
-
getChunkingConfig
-
getHeaders
-
getDelayedDataCheckConfig
-
getMaxEmptySearches
-
getIndicesOptions
-
getRuntimeMappings
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
equals
The lists of indices and types are compared for equality but they are not sorted first so this test could fail simply because the indices and types lists are in different orders. -
hashCode
public int hashCode() -
toString
-
defaultFrequency
public org.elasticsearch.core.TimeValue defaultFrequency(org.elasticsearch.core.TimeValue bucketSpan, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) Calculates a sensible default frequency for a given bucket span.The default depends on the bucket span:
- <= 2 mins -> 1 min
- <= 20 mins -> bucket span / 2
- <= 12 hours -> 10 mins
- > 12 hours -> 1 hour
- Parameters:
bucketSpan- the bucket span- Returns:
- the default frequency
-