java.lang.Object
org.elasticsearch.xpack.core.ml.job.results.Bucket
All Implemented Interfaces:
Writeable, ToXContent, ToXContentObject

public class Bucket extends Object implements ToXContentObject, Writeable
Bucket Result POJO
  • Field Details

  • Constructor Details

  • Method Details

    • readOldPerPartitionNormalization

      public static Bucket readOldPerPartitionNormalization(StreamInput in) throws IOException
      Throws:
      IOException
    • writeTo

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

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

      public String getJobId()
    • getId

      public String getId()
    • getEpoch

      public long getEpoch()
      Timestamp expressed in seconds since the epoch (rather than Java's convention of milliseconds).
    • getTimestamp

      public Date getTimestamp()
    • getBucketSpan

      public long getBucketSpan()
      Bucketspan expressed in seconds
    • getAnomalyScore

      public double getAnomalyScore()
    • setAnomalyScore

      public void setAnomalyScore(double anomalyScore)
    • getInitialAnomalyScore

      public double getInitialAnomalyScore()
    • setInitialAnomalyScore

      public void setInitialAnomalyScore(double initialAnomalyScore)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRecords

      public List<AnomalyRecord> getRecords()
      Get all the anomaly records associated with this bucket. The records are not part of the bucket document. They will only be present when the bucket was retrieved and expanded to contain the associated records.
      Returns:
      the anomaly records for the bucket IF the bucket was expanded.
    • setRecords

      public void setRecords(List<AnomalyRecord> records)
    • getEventCount

      public long getEventCount()
      The number of records (events) actually processed in this bucket.
    • setEventCount

      public void setEventCount(long value)
    • isInterim

      public boolean isInterim()
    • setInterim

      public void setInterim(boolean interim)
    • getProcessingTimeMs

      public long getProcessingTimeMs()
    • setProcessingTimeMs

      public void setProcessingTimeMs(long timeMs)
    • getBucketInfluencers

      public List<BucketInfluencer> getBucketInfluencers()
    • setBucketInfluencers

      public void setBucketInfluencers(List<BucketInfluencer> bucketInfluencers)
    • addBucketInfluencer

      public void addBucketInfluencer(BucketInfluencer bucketInfluencer)
    • getScheduledEvents

      public List<String> getScheduledEvents()
    • setScheduledEvents

      public void setScheduledEvents(List<String> scheduledEvents)
    • getEventIngested

      public Instant getEventIngested()
    • setEventIngested

      public void setEventIngested(Instant eventIngested)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Compare all the fields and embedded anomaly records (if any)
      Overrides:
      equals in class Object
    • isNormalizable

      public boolean isNormalizable()
      This method encapsulated the logic for whether a bucket should be normalized. Buckets that have a zero anomaly score themselves and no partition scores with non-zero score should not be normalized as their score will not change and they will just add overhead.
      Returns:
      true if the bucket should be normalized or false otherwise