Module org.elasticsearch.server
Record Class HealthTracker.HealthProgress<T>
java.lang.Object
java.lang.Record
org.elasticsearch.health.node.tracker.HealthTracker.HealthProgress<T>
- Type Parameters:
T
- the type that the health tracker returns
- Enclosing class:
- HealthTracker<T>
public static record HealthTracker.HealthProgress<T>(HealthTracker<T> healthTracker, T previousHealth, T currentHealth)
extends Record
A record for storing the previous and current value of a health check. This allows us to be sure no concurrent processes have
updated the health check's reference value.
-
Constructor Summary
ConstructorDescriptionHealthProgress
(HealthTracker<T> healthTracker, T previousHealth, T currentHealth) Creates an instance of aHealthProgress
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrentHealth
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
final int
hashCode()
Returns a hash code value for this object.Returns the value of thehealthTracker
record component.Returns the value of thepreviousHealth
record component.void
Update the reference value of the health tracker with the current health info.final String
toString()
Returns a string representation of this record class.void
-
Constructor Details
-
HealthProgress
Creates an instance of aHealthProgress
record class.- Parameters:
healthTracker
- the value for thehealthTracker
record componentpreviousHealth
- the value for thepreviousHealth
record componentcurrentHealth
- the value for thecurrentHealth
record component
-
-
Method Details
-
hasChanged
public boolean hasChanged() -
updateRequestBuilder
-
recordProgressIfRelevant
public void recordProgressIfRelevant()Update the reference value of the health tracker with the current health info. SeeHealthTracker.updateLastReportedHealth(T, T)
for more info. -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
healthTracker
Returns the value of thehealthTracker
record component.- Returns:
- the value of the
healthTracker
record component
-
previousHealth
Returns the value of thepreviousHealth
record component.- Returns:
- the value of the
previousHealth
record component
-
currentHealth
Returns the value of thecurrentHealth
record component.- Returns:
- the value of the
currentHealth
record component
-