Record Class RaftHealthCheck.Status
java.lang.Object
java.lang.Record
com.loomcache.server.consensus.RaftHealthCheck.Status
- Enclosing class:
RaftHealthCheck
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecapturedAtrecord component.longReturns the value of thecommitIndexrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thelastAppliedrecord component.@Nullable StringleaderId()Returns the value of theleaderIdrecord component.role()Returns the value of therolerecord component.longterm()Returns the value of thetermrecord component.longReturns the value of thetimeSinceLastHeartbeatMsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Status
public Status(RaftState role, long term, long commitIndex, long lastApplied, @Nullable String leaderId, long timeSinceLastHeartbeatMs, Instant capturedAt) Creates an instance of aStatusrecord class.- Parameters:
role- the value for therolerecord componentterm- the value for thetermrecord componentcommitIndex- the value for thecommitIndexrecord componentlastApplied- the value for thelastAppliedrecord componentleaderId- the value for theleaderIdrecord componenttimeSinceLastHeartbeatMs- the value for thetimeSinceLastHeartbeatMsrecord componentcapturedAt- the value for thecapturedAtrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
term
public long term()Returns the value of thetermrecord component.- Returns:
- the value of the
termrecord component
-
commitIndex
public long commitIndex()Returns the value of thecommitIndexrecord component.- Returns:
- the value of the
commitIndexrecord component
-
lastApplied
public long lastApplied()Returns the value of thelastAppliedrecord component.- Returns:
- the value of the
lastAppliedrecord component
-
leaderId
Returns the value of theleaderIdrecord component.- Returns:
- the value of the
leaderIdrecord component
-
timeSinceLastHeartbeatMs
public long timeSinceLastHeartbeatMs()Returns the value of thetimeSinceLastHeartbeatMsrecord component.- Returns:
- the value of the
timeSinceLastHeartbeatMsrecord component
-
capturedAt
Returns the value of thecapturedAtrecord component.- Returns:
- the value of the
capturedAtrecord component
-