Package org.apache.pekko.cluster
Class Member
java.lang.Object
org.apache.pekko.cluster.Member
- All Implemented Interfaces:
Serializable
Represents the address, current status, and roles of a cluster member node.
Note: hashCode
and equals
are solely based on the underlying Address
, not its MemberStatus
and roles.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddress()
static scala.math.Ordering<Address>
Address
ordering type class, sorts addresses by host and port.static scala.math.Ordering<Member>
Sort members by age, i.e.copy
(MemberStatus status) copyUp
(int upNumber) boolean
getRoles()
Java APIint
hashCode()
boolean
static Member
highestPriorityOf
(Member m1, Member m2) Picks the Member with the highest "priority" MemberStatus.boolean
isOlderThan
(Member other) Is this member older, has been part of cluster longer, than another member.static scala.collection.immutable.Set<Member>
none()
static scala.math.Ordering<Member>
ordering()
Member
ordering type class, sorts members by host and port.scala.collection.immutable.Set<String>
roles()
status()
toString()
-
Method Details
-
none
-
addressOrdering
Address
ordering type class, sorts addresses by host and port. -
ordering
Member
ordering type class, sorts members by host and port. -
ageOrdering
Sort members by age, i.e. usingisOlderThan(org.apache.pekko.cluster.Member)
.Note that it only makes sense to compare with other members of same data center. To avoid mistakes of comparing members of different data centers it will throw
IllegalArgumentException
if the members belong to different data centers. -
highestPriorityOf
Picks the Member with the highest "priority" MemberStatus. Where highest priority is furthest along the membership state machine -
uniqueAddress
-
status
-
roles
-
appVersion
-
dataCenter
-
address
-
hashCode
public int hashCode() -
equals
-
toString
-
hasRole
-
getRoles
Java API -
isOlderThan
Is this member older, has been part of cluster longer, than another member. It is only correct when comparing two existing members in a cluster. A member that joined after removal of another member may be considered older than the removed member.Note that it only makes sense to compare with other members of same data center (upNumber has a higher risk of being reused across data centers). To avoid mistakes of comparing members of different data centers this method will throw
IllegalArgumentException
if the members belong to different data centers.- Throws:
IllegalArgumentException
-
copy
-
copyUp
-