Class Detector
- java.lang.Object
-
- org.elasticsearch.client.ml.job.config.Detector
-
- All Implemented Interfaces:
ToXContent,ToXContentObject
public class Detector extends Object implements ToXContentObject
Defines the fields and functions used in the analysis. A combination offield_name,by_field_nameandover_field_namecan be used depending on the specific function chosen. For more information see configuring detectors and detector functions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDetector.Builderstatic classDetector.ExcludeFrequent-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description static ParseFieldBY_FIELD_NAME_FIELDstatic ParseFieldCUSTOM_RULES_FIELDstatic ParseFieldDETECTOR_DESCRIPTION_FIELDstatic ParseFieldDETECTOR_INDEXstatic ParseFieldEXCLUDE_FREQUENT_FIELDstatic ParseFieldFIELD_NAME_FIELDstatic ParseFieldFUNCTION_FIELDstatic ParseFieldOVER_FIELD_NAME_FIELDstatic ObjectParser<Detector.Builder,Void>PARSERstatic ParseFieldPARTITION_FIELD_NAME_FIELDstatic ParseFieldUSE_NULL_FIELD-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Detector.Builderbuilder()booleanequals(Object other)StringgetByFieldName()The 'by' field ornullif not set.StringgetDetectorDescription()intgetDetectorIndex()Detector.ExcludeFrequentgetExcludeFrequent()Excludes frequently-occurring metrics from the analysis; can apply to 'by' field, 'over' field, or bothStringgetFieldName()The Analysis fieldDetectorFunctiongetFunction()The analysis function used e.g.StringgetOverFieldName()The 'over' field ornullif not set.StringgetPartitionFieldName()Segments the analysis along another field to have completely independent baselines for each instance of partitionfieldList<DetectionRule>getRules()inthashCode()booleanisUseNull()Where there isn't a value for the 'by' or 'over' field should a new series be used as the 'null' series.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
DETECTOR_DESCRIPTION_FIELD
public static final ParseField DETECTOR_DESCRIPTION_FIELD
-
FUNCTION_FIELD
public static final ParseField FUNCTION_FIELD
-
FIELD_NAME_FIELD
public static final ParseField FIELD_NAME_FIELD
-
BY_FIELD_NAME_FIELD
public static final ParseField BY_FIELD_NAME_FIELD
-
OVER_FIELD_NAME_FIELD
public static final ParseField OVER_FIELD_NAME_FIELD
-
PARTITION_FIELD_NAME_FIELD
public static final ParseField PARTITION_FIELD_NAME_FIELD
-
USE_NULL_FIELD
public static final ParseField USE_NULL_FIELD
-
EXCLUDE_FREQUENT_FIELD
public static final ParseField EXCLUDE_FREQUENT_FIELD
-
CUSTOM_RULES_FIELD
public static final ParseField CUSTOM_RULES_FIELD
-
DETECTOR_INDEX
public static final ParseField DETECTOR_INDEX
-
PARSER
public static final ObjectParser<Detector.Builder,Void> PARSER
-
-
Method Detail
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
getDetectorDescription
public String getDetectorDescription()
-
getFunction
public DetectorFunction getFunction()
The analysis function used e.g. count, rare, min etc.- Returns:
- The function or
nullif not set
-
getFieldName
public String getFieldName()
The Analysis field- Returns:
- The field to analyse
-
getByFieldName
public String getByFieldName()
The 'by' field ornullif not set.- Returns:
- The 'by' field
-
getOverFieldName
public String getOverFieldName()
The 'over' field ornullif not set.- Returns:
- The 'over' field
-
getPartitionFieldName
public String 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
public Detector.ExcludeFrequent 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
public List<DetectionRule> getRules()
-
getDetectorIndex
public int getDetectorIndex()
- Returns:
- the detector index or a negative number if unknown
-
builder
public static Detector.Builder builder()
-
-