Module org.elasticsearch.xcore
Class AnalysisLimits
java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.AnalysisLimits
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public class AnalysisLimits
extends Object
implements org.elasticsearch.xcontent.ToXContentObject, Writeable
Analysis limits for autodetect. In particular,
this is a collection of parameters that allow limiting
the resources used by the job.
-
Nested Class Summary
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 longstatic final longPrior to 6.1 the default model memory size limit was 4GB, and defined in the C++ code.static final org.elasticsearch.xcontent.ConstructingObjectParser<AnalysisLimits, Void> static final org.elasticsearch.xcontent.ParseFieldSerialisation field namesstatic final longstatic final org.elasticsearch.xcontent.ConstructingObjectParser<AnalysisLimits, Void> Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionAnalysisLimits(Long categorizationExamplesLimit) AnalysisLimits(Long modelMemoryLimitMb, Long categorizationExamplesLimit) -
Method Summary
Modifier and TypeMethodDescriptionbooleanOverridden equality testGets the limit to the number of examples that are stored per categoryMaximum size of the model in MB before the anomaly detector will drop new samples to prevent the model using any more memory.inthashCode()org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) static AnalysisLimitsvalidateAndSetDefaults(AnalysisLimits source, ByteSizeValue maxModelMemoryLimit, long defaultModelMemoryLimit) Creates a newAnalysisLimitsobject after validating it against external limitations and filling missing values with their defaults.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
-
DEFAULT_MODEL_MEMORY_LIMIT_MB
public static final long DEFAULT_MODEL_MEMORY_LIMIT_MBPrior to 6.1 the default model memory size limit was 4GB, and defined in the C++ code. The default is now 1GB and defined here in the Java code. Prior to 6.3, a value ofnullmeans that the old default value should be used. From 6.3 onwards, the value will always be explicit.- See Also:
-
PRE_6_1_DEFAULT_MODEL_MEMORY_LIMIT_MB
public static final long PRE_6_1_DEFAULT_MODEL_MEMORY_LIMIT_MB- See Also:
-
DEFAULT_CATEGORIZATION_EXAMPLES_LIMIT
public static final long DEFAULT_CATEGORIZATION_EXAMPLES_LIMIT- See Also:
-
MODEL_MEMORY_LIMIT
public static final org.elasticsearch.xcontent.ParseField MODEL_MEMORY_LIMITSerialisation field names -
CATEGORIZATION_EXAMPLES_LIMIT
public static final org.elasticsearch.xcontent.ParseField CATEGORIZATION_EXAMPLES_LIMIT -
LENIENT_PARSER
public static final org.elasticsearch.xcontent.ConstructingObjectParser<AnalysisLimits,Void> LENIENT_PARSER -
STRICT_PARSER
public static final org.elasticsearch.xcontent.ConstructingObjectParser<AnalysisLimits,Void> STRICT_PARSER
-
-
Constructor Details
-
AnalysisLimits
-
AnalysisLimits
-
AnalysisLimits
- Throws:
IOException
-
-
Method Details
-
validateAndSetDefaults
public static AnalysisLimits validateAndSetDefaults(@Nullable AnalysisLimits source, @Nullable ByteSizeValue maxModelMemoryLimit, long defaultModelMemoryLimit) Creates a newAnalysisLimitsobject after validating it against external limitations and filling missing values with their defaults. Validations:- check model memory limit doesn't exceed the MAX_MODEL_MEM setting
- Parameters:
source- an optionalAnalysisLimitswhose explicit values will be copiedmaxModelMemoryLimit- the max allowed model memory limitdefaultModelMemoryLimit- the default model memory limit to be used if an explicit value is missing- Returns:
- a new
AnalysisLimitsthat is validated and has no missing values
-
getModelMemoryLimit
Maximum size of the model in MB before the anomaly detector will drop new samples to prevent the model using any more memory.- Returns:
- The set memory limit or
nullif not set
-
getCategorizationExamplesLimit
Gets the limit to the number of examples that are stored per category- Returns:
- the limit or
nullif not set
-
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
Overridden equality test -
hashCode
public int hashCode()
-