Record Class SwimGossipProtocol.MemberInfo
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.SwimGossipProtocol.MemberInfo
- Record Components:
nodeId- unique identifier for the memberaddress- network address (IP or hostname)port- network port for SWIM protocolstate- current membership stateincarnation- incarnation number for refuting false suspicionslastUpdateTime- timestamp (milliseconds) of the last state change
- Enclosing class:
SwimGossipProtocol
public static record SwimGossipProtocol.MemberInfo(String nodeId, String address, int port, SwimGossipProtocol.MemberState state, long incarnation, long lastUpdateTime)
extends Record
Information about a cluster member.
-
Constructor Summary
ConstructorsConstructorDescriptionMemberInfo(String nodeId, String address, int port, SwimGossipProtocol.MemberState state, long incarnation, long lastUpdateTime) Creates an instance of aMemberInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord 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 theincarnationrecord component.booleanisAlive()Check if this member is alive.booleanisDead()Check if this member is dead.booleanCheck if this member is suspected.longReturns the value of thelastUpdateTimerecord component.nodeId()Returns the value of thenodeIdrecord component.intport()Returns the value of theportrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MemberInfo
public MemberInfo(String nodeId, String address, int port, SwimGossipProtocol.MemberState state, long incarnation, long lastUpdateTime) Creates an instance of aMemberInforecord class.- Parameters:
nodeId- the value for thenodeIdrecord componentaddress- the value for theaddressrecord componentport- the value for theportrecord componentstate- the value for thestaterecord componentincarnation- the value for theincarnationrecord componentlastUpdateTime- the value for thelastUpdateTimerecord component
-
-
Method Details
-
isAlive
public boolean isAlive()Check if this member is alive.- Returns:
- true if state is Alive
-
isSuspect
public boolean isSuspect()Check if this member is suspected.- Returns:
- true if state is Suspect
-
isDead
public boolean isDead()Check if this member is dead.- Returns:
- true if state is Dead
-
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. -
nodeId
-
address
-
port
-
state
-
incarnation
public long incarnation()Returns the value of theincarnationrecord component.- Returns:
- the value of the
incarnationrecord component
-
lastUpdateTime
public long lastUpdateTime()Returns the value of thelastUpdateTimerecord component.- Returns:
- the value of the
lastUpdateTimerecord component
-