java.lang.Object
org.elasticsearch.xpack.core.ml.job.results.Bucket
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
Bucket Result POJO
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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 ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ConstructingObjectParser<Bucket, Void> static final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final StringResult typestatic final ParseFieldstatic final ParseFieldstatic final ConstructingObjectParser<Bucket, Void> Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBucketInfluencer(BucketInfluencer bucketInfluencer) booleanCompare all the fields and embedded anomaly records (if any)doublelongBucketspan expressed in secondslonggetEpoch()Timestamp expressed in seconds since the epoch (rather than Java's convention of milliseconds).longThe number of records (events) actually processed in this bucket.getId()doublegetJobId()longGet all the anomaly records associated with this bucket.inthashCode()booleanbooleanThis method encapsulated the logic for whether a bucket should be normalized.static BucketvoidsetAnomalyScore(double anomalyScore) voidsetBucketInfluencers(List<BucketInfluencer> bucketInfluencers) voidsetEventCount(long value) voidsetEventIngested(Instant eventIngested) voidsetInitialAnomalyScore(double initialAnomalyScore) voidsetInterim(boolean interim) voidsetProcessingTimeMs(long timeMs) voidsetRecords(List<AnomalyRecord> records) voidsetScheduledEvents(List<String> scheduledEvents) toString()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
ANOMALY_SCORE
-
INITIAL_ANOMALY_SCORE
-
EVENT_COUNT
-
RECORDS
-
BUCKET_INFLUENCERS
-
BUCKET_SPAN
-
PROCESSING_TIME_MS
-
SCHEDULED_EVENTS
-
RESULTS_FIELD
-
RESULT_TYPE_VALUE
Result type- See Also:
-
RESULT_TYPE_FIELD
-
STRICT_PARSER
-
LENIENT_PARSER
-
-
Constructor Details
-
Bucket
-
Bucket
-
Bucket
- Throws:
IOException
-
-
Method Details
-
readOldPerPartitionNormalization
- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
getJobId
-
getId
-
getEpoch
public long getEpoch()Timestamp expressed in seconds since the epoch (rather than Java's convention of milliseconds). -
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
-
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
-
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
-
setBucketInfluencers
-
addBucketInfluencer
-
getScheduledEvents
-
setScheduledEvents
-
getEventIngested
-
setEventIngested
-
hashCode
public int hashCode() -
equals
Compare all the fields and embedded anomaly records (if any) -
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
-