Class Member
Represents the address, current status, and roles of a cluster member node.
Inherited Members
Namespace: Akka.Cluster
Assembly: Akka.Cluster.dll
Syntax
public class Member : IComparable<Member>, IComparable
Remarks
NOTE: GetHashCode() and Equals(object) are solely based on the underlying Address, not its MemberStatus and roles.
Fields
| Edit this page View SourceAddressOrdering
Address ordering type class, sorts addresses by host and port.
Declaration
public static readonly IComparer<Address> AddressOrdering
Field Value
| Type | Description |
|---|---|
| IComparer<Address> |
AgeOrdering
Compares members by their upNumber to determine which is oldest / youngest.
Declaration
public static readonly IComparer<Member> AgeOrdering
Field Value
| Type | Description |
|---|---|
| IComparer<Member> |
Properties
| Edit this page View SourceAddress
The Address for this member.
Declaration
public Address Address { get; }
Property Value
| Type | Description |
|---|---|
| Address |
AppVersion
Application version
Declaration
public AppVersion AppVersion { get; }
Property Value
| Type | Description |
|---|---|
| AppVersion |
Roles
The set of roles for the current member. Can be empty.
Declaration
public ImmutableHashSet<string> Roles { get; }
Property Value
| Type | Description |
|---|---|
| ImmutableHashSet<string> |
Status
The status of the current member.
Declaration
public MemberStatus Status { get; }
Property Value
| Type | Description |
|---|---|
| MemberStatus |
UniqueAddress
TBD
Declaration
public UniqueAddress UniqueAddress { get; }
Property Value
| Type | Description |
|---|---|
| UniqueAddress |
Methods
| Edit this page View SourceCompareTo(Member)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(Member other)
Parameters
| Type | Name | Description |
|---|---|---|
| Member | other | An object to compare with this instance. |
Returns
| Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
Copy(MemberStatus)
Creates a copy of this member with the status provided.
Declaration
public Member Copy(MemberStatus status)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberStatus | status | The new status of this member. |
Returns
| Type | Description |
|---|---|
| Member | A new copy of this member with the provided status. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | TBD |
CopyUp(int)
Creates a copy of this member with the provided upNumber.
Declaration
public Member CopyUp(int upNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| int | upNumber | The new upNumber for this member. |
Returns
| Type | Description |
|---|---|
| Member | A new copy of this member with the provided upNumber. |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceHasRole(string)
Checks to see if a member supports a particular role.
Declaration
public bool HasRole(string role)
Parameters
| Type | Name | Description |
|---|---|---|
| string | role | The rolename to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
HighestPriorityOf(Member, Member)
Picks the Member with the highest "priority" MemberStatus.
Declaration
public static Member HighestPriorityOf(Member m1, Member m2)
Parameters
| Type | Name | Description |
|---|---|---|
| Member | m1 | The first member to compare. |
| Member | m2 | The second member to compare. |
Returns
| Type | Description |
|---|---|
| Member | The higher priority of the two members. |
IsOlderThan(Member)
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.
Declaration
public bool IsOlderThan(Member other)
Parameters
| Type | Name | Description |
|---|---|---|
| Member | other | The other member to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
PickHighestPriority(IEnumerable<Member>, IEnumerable<Member>)
Combines and sorts two lists of Member into a single list ordered by highest prioirity
Declaration
public static ImmutableHashSet<Member> PickHighestPriority(IEnumerable<Member> a, IEnumerable<Member> b)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Member> | a | The first collection of members. |
| IEnumerable<Member> | b | The second collection of members. |
Returns
| Type | Description |
|---|---|
| ImmutableHashSet<Member> | An immutable hash set containing the members with the highest priority. |
PickNextTransition(Member, Member)
Compares two copies OF THE SAME MEMBER and returns whichever one is a valid transition of the other.
Declaration
public static Member PickNextTransition(Member a, Member b)
Parameters
| Type | Name | Description |
|---|---|---|
| Member | a | First member instance. |
| Member | b | Second member instance. |
Returns
| Type | Description |
|---|---|
| Member | If a and b are different members, this method will return |
PickNextTransition(IEnumerable<Member>, IEnumerable<Member>)
Combines and sorts two lists of Member into a single list ordered by Member's valid transitions
Declaration
public static ImmutableSortedSet<Member> PickNextTransition(IEnumerable<Member> a, IEnumerable<Member> b)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Member> | a | The first collection of members. |
| IEnumerable<Member> | b | The second collection of members. |
Returns
| Type | Description |
|---|---|
| ImmutableSortedSet<Member> | An immutable hash set containing the members with the next logical transition. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Edit this page