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.
  • Field Details

    • DEFAULT_MODEL_MEMORY_LIMIT_MB

      public static final long DEFAULT_MODEL_MEMORY_LIMIT_MB
      Prior 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 of null means 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_LIMIT
      Serialisation 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

      public AnalysisLimits(Long categorizationExamplesLimit)
    • AnalysisLimits

      public AnalysisLimits(Long modelMemoryLimitMb, Long categorizationExamplesLimit)
    • AnalysisLimits

      public AnalysisLimits(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • validateAndSetDefaults

      public static AnalysisLimits validateAndSetDefaults(@Nullable AnalysisLimits source, @Nullable ByteSizeValue maxModelMemoryLimit, long defaultModelMemoryLimit)
      Creates a new AnalysisLimits object 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 optional AnalysisLimits whose explicit values will be copied
      maxModelMemoryLimit - the max allowed model memory limit
      defaultModelMemoryLimit - the default model memory limit to be used if an explicit value is missing
      Returns:
      a new AnalysisLimits that is validated and has no missing values
    • getModelMemoryLimit

      @Nullable public Long 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 null if not set
    • getCategorizationExamplesLimit

      @Nullable public Long getCategorizationExamplesLimit()
      Gets the limit to the number of examples that are stored per category
      Returns:
      the limit or null if not set
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • equals

      public boolean equals(Object other)
      Overridden equality test
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object