Module org.elasticsearch.server
Record Class ErrorEntry
java.lang.Object
java.lang.Record
org.elasticsearch.action.datastreams.lifecycle.ErrorEntry
- All Implemented Interfaces:
Comparable<ErrorEntry>,Writeable,ToXContent,ToXContentObject
public record ErrorEntry(long firstOccurrenceTimestamp, String error, long recordedTimestamp, int retryCount)
extends Record
implements Writeable, ToXContentObject, Comparable<ErrorEntry>
Represents the recorded error for an index that Data Stream Lifecycle Service encountered.
-
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 ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionErrorEntry(long firstOccurrenceTimestamp, String error, long recordedTimestamp, int retryCount) Creates an instance of aErrorEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintCompares two error entries by the number of retries, in reversed order by default.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.longReturns the value of thefirstOccurrenceTimestamprecord component.final inthashCode()Returns a hash code value for this object.static ErrorEntryincrementRetryCount(ErrorEntry existingRecord, LongSupplier nowSupplier) Creates a new ErrorEntry with the same first occurent timestamp and error message as the provided existing record, but with a fresh timestamp for the latest occurrence and an incremented retry count.longReturns the value of therecordedTimestamprecord component.intReturns the value of theretryCountrecord component.final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.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
-
FIRST_OCCURRENCE_FIELD
-
FIRST_OCCURRENCE_MILLIS_FIELD
-
MESSAGE_FIELD
-
LAST_RECORDED_MILLIS_FIELD
-
LAST_RECORDED_FIELD
-
RETRY_COUNT_FIELD
-
-
Constructor Details
-
ErrorEntry
- Throws:
IOException
-
ErrorEntry
public ErrorEntry(long firstOccurrenceTimestamp, String error, long recordedTimestamp, int retryCount) Creates an instance of aErrorEntryrecord class.- Parameters:
firstOccurrenceTimestamp- the value for thefirstOccurrenceTimestamprecord componenterror- the value for theerrorrecord componentrecordedTimestamp- the value for therecordedTimestamprecord componentretryCount- the value for theretryCountrecord component
-
-
Method Details
-
incrementRetryCount
Creates a new ErrorEntry with the same first occurent timestamp and error message as the provided existing record, but with a fresh timestamp for the latest occurrence and an incremented retry count. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
compareTo
Compares two error entries by the number of retries, in reversed order by default.- Specified by:
compareToin interfaceComparable<ErrorEntry>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
firstOccurrenceTimestamp
public long firstOccurrenceTimestamp()Returns the value of thefirstOccurrenceTimestamprecord component.- Returns:
- the value of the
firstOccurrenceTimestamprecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
recordedTimestamp
public long recordedTimestamp()Returns the value of therecordedTimestamprecord component.- Returns:
- the value of the
recordedTimestamprecord component
-
retryCount
public int retryCount()Returns the value of theretryCountrecord component.- Returns:
- the value of the
retryCountrecord component
-