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.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionErrorEntry
(long firstOccurrenceTimestamp, String error, long recordedTimestamp, int retryCount) Creates an instance of aErrorEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares two error entries by the number of retries, in reversed order by default.final boolean
Indicates whether some other object is "equal to" this one.error()
Returns the value of theerror
record component.long
Returns the value of thefirstOccurrenceTimestamp
record component.final int
hashCode()
Returns a hash code value for this object.static ErrorEntry
incrementRetryCount
(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.long
Returns the value of therecordedTimestamp
record component.int
Returns the value of theretryCount
record component.final String
toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aErrorEntry
record class.- Parameters:
firstOccurrenceTimestamp
- the value for thefirstOccurrenceTimestamp
record componenterror
- the value for theerror
record componentrecordedTimestamp
- the value for therecordedTimestamp
record componentretryCount
- the value for theretryCount
record 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:
toXContent
in interfaceToXContent
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
compareTo
Compares two error entries by the number of retries, in reversed order by default.- Specified by:
compareTo
in 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 thefirstOccurrenceTimestamp
record component.- Returns:
- the value of the
firstOccurrenceTimestamp
record component
-
error
Returns the value of theerror
record component.- Returns:
- the value of the
error
record component
-
recordedTimestamp
public long recordedTimestamp()Returns the value of therecordedTimestamp
record component.- Returns:
- the value of the
recordedTimestamp
record component
-
retryCount
public int retryCount()Returns the value of theretryCount
record component.- Returns:
- the value of the
retryCount
record component
-