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
| Improve this Doc 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
| Improve this Doc 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 |
---|---|
System.Collections.Immutable.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
| Improve this Doc View SourceCompareTo(Member)
Declaration
public int CompareTo(Member other)
Parameters
Type | Name | Description |
---|---|---|
Member | other |
Returns
Type | Description |
---|---|
Int32 |
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(Int32)
Creates a copy of this member with the provided upNumber.
Declaration
public Member CopyUp(int upNumber)
Parameters
Type | Name | Description |
---|---|---|
Int32 | upNumber | The new upNumber for this member. |
Returns
Type | Description |
---|---|
Member | A new copy of this member with the provided upNumber. |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc 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 |
---|---|
Boolean |
|
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 |
---|---|
Boolean |
|
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 |
---|---|
System.Collections.Immutable.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 |
---|---|
System.Collections.Immutable.ImmutableSortedSet<Member> | An immutable hash set containing the members with the next logical transition. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceIComparable.CompareTo(Object)
Declaration
int IComparable.CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Int32 |