Class Host
Represents a Cassandra node.
Inheritance
Implements
Inherited Members
Namespace: Dse
Assembly: Dse.dll
Syntax
public class Host : IEquatable<Host>
Constructors
Host(IPEndPoint, IReconnectionPolicy)
Creates a new instance of Host.
Declaration
public Host(IPEndPoint address, IReconnectionPolicy reconnectionPolicy)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPEndPoint | address | |
IReconnectionPolicy | reconnectionPolicy |
Properties
Address
Gets the node address.
Declaration
public IPEndPoint Address { get; }
Property Value
Type | Description |
---|---|
System.Net.IPEndPoint |
CassandraVersion
The Cassandra version the host is running.
Declaration
public Version CassandraVersion { get; }
Property Value
Type | Description |
---|---|
System.Version |
Datacenter
Gets the name of the datacenter this host is part of. The returned
datacenter name is the one as known by Cassandra. Also note that it is
possible for this information to not be available. In that case this method
returns null
and caller should always expect that possibility.
Declaration
public string Datacenter { get; }
Property Value
Type | Description |
---|---|
System.String |
DseVersion
Gets the DSE version the server is running. This property might be null on older server versions.
Declaration
public Version DseVersion { get; }
Property Value
Type | Description |
---|---|
System.Version |
HostId
Gets the node's host id.
Declaration
public Guid HostId { get; }
Property Value
Type | Description |
---|---|
System.Guid |
IsConsiderablyUp
This property is going to be removed in future versions, use IsUp instead. Used to determines if the host can be considered as UP
Declaration
public bool IsConsiderablyUp { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsUp
Determines if the host is UP for the driver
Declaration
public bool IsUp { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Rack
Gets the name of the rack this host is part of. The returned rack name is
the one as known by Cassandra. Also note that it is possible for this
information to not be available. In that case this method returns
null
and caller should always expect that possibility.
Declaration
public string Rack { get; }
Property Value
Type | Description |
---|---|
System.String |
Workloads
Gets the DSE Workloads the host is running.
This is based on the "workload" or "workloads" columns in system.local
and system.peers
.
Workload labels may vary depending on the DSE version in use; e.g. DSE 5.1 may report two distinct
workloads: Search
and Analytics
, while DSE 5.0 would report a single
SearchAnalytics
workload instead. The driver simply returns the workload labels as reported by
DSE, without any form of pre-processing.
When the information is unavailable, this property returns an empty collection.
Declaration
public IReadOnlyCollection<string> Workloads { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<System.String> |
Remarks
Collection can be considered as immutable.
Methods
BringUpIfDown()
Returns true if the host was DOWN and it was set as UP.
Declaration
public bool BringUpIfDown()
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Host)
Determines if the this instance can be considered equal to the provided host.
Declaration
public bool Equals(Host other)
Parameters
Type | Name | Description |
---|---|---|
Host | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
The hash value of the address of the host
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
SetAsRemoved()
Declaration
public void SetAsRemoved()
SetDown()
Sets the Host as Down. Returns false if it was already considered as Down by the driver.
Declaration
public bool SetDown()
Returns
Type | Description |
---|---|
System.Boolean |