java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.Detector
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public class Detector
extends Object
implements org.elasticsearch.xcontent.ToXContentObject, Writeable
Defines the fields to be used in the analysis.
fieldname must be set and only one of byFieldName
and overFieldName should be set.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumNested 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 Stringstatic final org.elasticsearch.xcontent.ParseFieldstatic final EnumSet<DetectorFunction> The set of functions that require a by-field namestatic final EnumSet<DetectorFunction> The set of functions that do not require a field, by field or over fieldstatic 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 EnumSet<DetectorFunction> The set of functions that require a field namestatic final org.elasticsearch.xcontent.ParseFieldstatic final EnumSet<DetectorFunction> This set of functions that cannot have an over-field name.static final org.elasticsearch.xcontent.ObjectParser<Detector.Builder, Void> static final EnumSet<DetectorFunction> The set of functions that cannot have an over-field namestatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldstatic final EnumSet<DetectorFunction> The set of functions that require an over-field namestatic final org.elasticsearch.xcontent.ParseFieldstatic final Stringstatic final Character[]field names cannot contain any of these characters ", \static final org.elasticsearch.xcontent.ObjectParser<Detector.Builder, Void> static final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns a list with the byFieldName, overFieldName and partitionFieldName that are not nullThe 'by' field ornullif not set.Returns the set of by/over/partition termsintExcludes frequently-occurring metrics from the analysis; can apply to 'by' field, 'over' field, or bothThe Analysis fieldThe analysis function used e.g.The 'over' field ornullif not set.Segments the analysis along another field to have completely independent baselines for each instance of partitionfieldgetRules()inthashCode()booleanWhere there isn't a value for the 'by' or 'over' field should a new series be used as the 'null' series.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
DETECTOR_DESCRIPTION_FIELD
public static final org.elasticsearch.xcontent.ParseField DETECTOR_DESCRIPTION_FIELD -
FUNCTION_FIELD
public static final org.elasticsearch.xcontent.ParseField FUNCTION_FIELD -
FIELD_NAME_FIELD
public static final org.elasticsearch.xcontent.ParseField FIELD_NAME_FIELD -
BY_FIELD_NAME_FIELD
public static final org.elasticsearch.xcontent.ParseField BY_FIELD_NAME_FIELD -
OVER_FIELD_NAME_FIELD
public static final org.elasticsearch.xcontent.ParseField OVER_FIELD_NAME_FIELD -
PARTITION_FIELD_NAME_FIELD
public static final org.elasticsearch.xcontent.ParseField PARTITION_FIELD_NAME_FIELD -
USE_NULL_FIELD
public static final org.elasticsearch.xcontent.ParseField USE_NULL_FIELD -
EXCLUDE_FREQUENT_FIELD
public static final org.elasticsearch.xcontent.ParseField EXCLUDE_FREQUENT_FIELD -
CUSTOM_RULES_FIELD
public static final org.elasticsearch.xcontent.ParseField CUSTOM_RULES_FIELD -
DETECTOR_INDEX
public static final org.elasticsearch.xcontent.ParseField DETECTOR_INDEX -
LENIENT_PARSER
-
STRICT_PARSER
-
BY
- See Also:
-
OVER
- See Also:
-
COUNT_WITHOUT_FIELD_FUNCTIONS
The set of functions that do not require a field, by field or over field -
FIELD_NAME_FUNCTIONS
The set of functions that require a field name -
BY_FIELD_NAME_FUNCTIONS
The set of functions that require a by-field name -
OVER_FIELD_NAME_FUNCTIONS
The set of functions that require an over-field name -
NO_OVER_FIELD_NAME_FUNCTIONS
The set of functions that cannot have an over-field name -
LENIENT_NO_OVER_FIELD_NAME_FUNCTIONS
This set of functions that cannot have an over-field name. However, until versions [9.3.0, 9.2.4, 8.19.10] they were incorrectly allowed to have one. Therefore, we need to allow them leniently for backward compatibility, for otherwise an updated Elasticsearch fails to start up due to job validation errors. -
PROHIBITED_FIELDNAME_CHARACTERS
field names cannot contain any of these characters ", \ -
PROHIBITED
-
-
Constructor Details
-
Detector
- Throws:
IOException
-
-
Method Details
-
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
-
getDetectorDescription
-
getFunction
The analysis function used e.g. count, rare, min etc.- Returns:
- The function or
nullif not set
-
getFieldName
The Analysis field- Returns:
- The field to analyse
-
getByFieldName
The 'by' field ornullif not set.- Returns:
- The 'by' field
-
getOverFieldName
The 'over' field ornullif not set.- Returns:
- The 'over' field
-
getPartitionFieldName
Segments the analysis along another field to have completely independent baselines for each instance of partitionfield- Returns:
- The Partition Field
-
isUseNull
public boolean isUseNull()Where there isn't a value for the 'by' or 'over' field should a new series be used as the 'null' series.- Returns:
- true if the 'null' series should be created
-
getExcludeFrequent
Excludes frequently-occurring metrics from the analysis; can apply to 'by' field, 'over' field, or both- Returns:
- the value that the user set
-
getRules
-
getDetectorIndex
public int getDetectorIndex()- Returns:
- the detector index or a negative number if unknown
-
extractAnalysisFields
Returns a list with the byFieldName, overFieldName and partitionFieldName that are not null- Returns:
- a list with the byFieldName, overFieldName and partitionFieldName that are not null
-
extractReferencedFilters
-
getByOverPartitionTerms
Returns the set of by/over/partition terms -
equals
-
hashCode
public int hashCode()
-