Skip to main content

Manages high availability failover for Kinetica connections. More…

Public Member Functions

 HAFailoverManager ()
 Creates a new HAFailoverManager.
 
IList< ClusterAddressInfoGetHostAddresses ()
 Gets all cluster addresses.
 
IList< Uri > GetUrls ()
 Gets the list of URLs of the active head ranks of all clusters.
 
IList< Uri > GetFailoverUrls ()
 Gets the list of URLs in failover order.
 
ClusterAddressInfoGetClusterInfo ()
 Gets the active cluster’s information.
 
Uri? GetUrl ()
 Gets the current active URL.
 
void AddCluster (ClusterAddressInfo clusterInfo)
 Adds a cluster address to the manager.
 
void Initialize (IList< Uri > urls, Kinetica? kinetica=null)
 Initializes the manager with a list of URLs.
 
Uri SwitchUrl (Uri oldUrl, int oldNumClusterSwitches, Func< Uri, bool >? isClusterUsable=null)
 Switches to the next available cluster URL for HA failover.
 
 HAFailoverManager ()
 Creates a new HAFailoverManager.
 
IList< ClusterAddressInfoGetHostAddresses ()
 Gets all cluster addresses.
 
IList< Uri > GetUrls ()
 Gets the list of URLs of the active head ranks of all clusters.
 
IList< Uri > GetFailoverUrls ()
 Gets the list of URLs in failover order.
 
ClusterAddressInfoGetClusterInfo ()
 Gets the active cluster’s information.
 
Uri? GetUrl ()
 Gets the current active URL.
 
void AddCluster (ClusterAddressInfo clusterInfo)
 Adds a cluster address to the manager.
 
void Initialize (IList< Uri > urls, Kinetica? kinetica=null)
 Initializes the manager with a list of URLs.
 
Uri SwitchUrl (Uri oldUrl, int oldNumClusterSwitches, Func< Uri, bool >? isClusterUsable=null)
 Switches to the next available cluster URL for HA failover.
 

Static Public Attributes

const int DefaultHostManagerPort = 9300
 The default port used for host-manager URLs (9300).
 

Properties

bool DisableFailover [get, set]
 Whether failover is disabled.
 
bool DisableAutoDiscovery [get, set]
 Whether auto-discovery is disabled.
 
int HostManagerPort [get, set]
 Host manager port.
 
HAFailoverOrder FailoverOrder [get, set]
 HA failover order.
 
Regex? HostnameRegex [get, set]
 Optional hostname regex for filtering URLs.
 
ILogger Logger = Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance [get, set]
 Optional logger (category “Kinetica.HAFailover”).
 
int HARingSize [get]
 Gets the number of clusters in the HA ring.
 
int NumClusterSwitches [get]
 Gets the number of times the client has switched to a different cluster.
 

Detailed Description

Manages high availability failover for Kinetica connections.

This class tracks multiple cluster addresses and handles failover logic when a cluster becomes unavailable.

Definition at line 194 of file HAFailover.cs.

Constructor & Destructor Documentation

◆ HAFailoverManager() [1/2]

kinetica.HAFailoverManager.HAFailoverManager ()
inline

Creates a new HAFailoverManager.

Definition at line 248 of file HAFailover.cs.

◆ HAFailoverManager() [2/2]

kinetica.HAFailoverManager.HAFailoverManager ()
inline

Creates a new HAFailoverManager.

Definition at line 248 of file HAFailover.cs.

Member Function Documentation

◆ AddCluster() [1/2]

void kinetica.HAFailoverManager.AddCluster (ClusterAddressInfoclusterInfo)
inline

Adds a cluster address to the manager.

Definition at line 360 of file HAFailover.cs.

◆ AddCluster() [2/2]

void kinetica.HAFailoverManager.AddCluster (ClusterAddressInfoclusterInfo)
inline

Adds a cluster address to the manager.

Definition at line 360 of file HAFailover.cs.

◆ GetClusterInfo() [1/2]

ClusterAddressInfo? kinetica.HAFailoverManager.GetClusterInfo ()
inline

Gets the active cluster’s information.

Definition at line 328 of file HAFailover.cs.

◆ GetClusterInfo() [2/2]

ClusterAddressInfo? kinetica.HAFailoverManager.GetClusterInfo ()
inline

Gets the active cluster’s information.

Definition at line 328 of file HAFailover.cs.

◆ GetFailoverUrls() [1/2]

IList< Uri > kinetica.HAFailoverManager.GetFailoverUrls ()
inline

Gets the list of URLs in failover order.

Definition at line 314 of file HAFailover.cs.

◆ GetFailoverUrls() [2/2]

IList< Uri > kinetica.HAFailoverManager.GetFailoverUrls ()
inline

Gets the list of URLs in failover order.

Definition at line 314 of file HAFailover.cs.

◆ GetHostAddresses() [1/2]

IList< ClusterAddressInfo > kinetica.HAFailoverManager.GetHostAddresses ()
inline

Gets all cluster addresses.

Definition at line 292 of file HAFailover.cs.

◆ GetHostAddresses() [2/2]

IList< ClusterAddressInfo > kinetica.HAFailoverManager.GetHostAddresses ()
inline

Gets all cluster addresses.

Definition at line 292 of file HAFailover.cs.

◆ GetUrl() [1/2]

Uri? kinetica.HAFailoverManager.GetUrl ()
inline

Gets the current active URL.

Definition at line 352 of file HAFailover.cs.

◆ GetUrl() [2/2]

Uri? kinetica.HAFailoverManager.GetUrl ()
inline

Gets the current active URL.

Definition at line 352 of file HAFailover.cs.

◆ GetUrls() [1/2]

IList< Uri > kinetica.HAFailoverManager.GetUrls ()
inline

Gets the list of URLs of the active head ranks of all clusters.

Definition at line 303 of file HAFailover.cs.

◆ GetUrls() [2/2]

IList< Uri > kinetica.HAFailoverManager.GetUrls ()
inline

Gets the list of URLs of the active head ranks of all clusters.

Definition at line 303 of file HAFailover.cs.

◆ Initialize() [1/2]

void kinetica.HAFailoverManager.Initialize (IList< Uri >urls,
Kinetica?kinetica = null )
inline

Initializes the manager with a list of URLs.

Parameters
urlsThe URLs to initialize with
kineticaThe Kinetica client for system property queries

Definition at line 373 of file HAFailover.cs.

◆ Initialize() [2/2]

void kinetica.HAFailoverManager.Initialize (IList< Uri >urls,
Kinetica?kinetica = null )
inline

Initializes the manager with a list of URLs.

Parameters
urlsThe URLs to initialize with
kineticaThe Kinetica client for system property queries

Definition at line 373 of file HAFailover.cs.

◆ SwitchUrl() [1/2]

Uri kinetica.HAFailoverManager.SwitchUrl (UrioldUrl,
intoldNumClusterSwitches,
Func< Uri, bool >?isClusterUsable = null )
inline

Switches to the next available cluster URL for HA failover.

Parameters
oldUrlThe URL that was in use when the failure occurred
oldNumClusterSwitchesThe switch count before this switch was initiated
isClusterUsablePredicate deciding whether a candidate cluster may be routed to: reachable, running, and not draining. A bare liveness ping is not sufficient – a draining cluster answers a ping but rejects queries – so this must consult the cluster’s drain state (see Kinetica.IsClusterUsable).
Returns
The new URL to use
Exceptions
KineticaExceptionIf failover is not possible

Definition at line 773 of file HAFailover.cs.

◆ SwitchUrl() [2/2]

Uri kinetica.HAFailoverManager.SwitchUrl (UrioldUrl,
intoldNumClusterSwitches,
Func< Uri, bool >?isClusterUsable = null )
inline

Switches to the next available cluster URL for HA failover.

Parameters
oldUrlThe URL that was in use when the failure occurred
oldNumClusterSwitchesThe switch count before this switch was initiated
isClusterUsablePredicate deciding whether a candidate cluster may be routed to: reachable, running, and not draining. A bare liveness ping is not sufficient – a draining cluster answers a ping but rejects queries – so this must consult the cluster’s drain state (see Kinetica.IsClusterUsable).
Returns
The new URL to use
Exceptions
KineticaExceptionIf failover is not possible

Definition at line 773 of file HAFailover.cs.

Member Data Documentation

◆ DefaultHostManagerPort

const int kinetica.HAFailoverManager.DefaultHostManagerPort = 9300
static

The default port used for host-manager URLs (9300).

Definition at line 197 of file HAFailover.cs.

Property Documentation

◆ DisableAutoDiscovery

bool kinetica.HAFailoverManager.DisableAutoDiscovery
getset

Whether auto-discovery is disabled.

Definition at line 223 of file HAFailover.cs.

◆ DisableFailover

bool kinetica.HAFailoverManager.DisableFailover
getset

Whether failover is disabled.

Definition at line 218 of file HAFailover.cs.

◆ FailoverOrder

HAFailoverOrder kinetica.HAFailoverManager.FailoverOrder
getset

HA failover order.

Definition at line 233 of file HAFailover.cs.

◆ HARingSize

int kinetica.HAFailoverManager.HARingSize
get

Gets the number of clusters in the HA ring.

Definition at line 264 of file HAFailover.cs.

◆ HostManagerPort

int kinetica.HAFailoverManager.HostManagerPort
getset

Host manager port.

Definition at line 228 of file HAFailover.cs.

◆ HostnameRegex

Regex kinetica.HAFailoverManager.HostnameRegex
getset

Optional hostname regex for filtering URLs.

Definition at line 238 of file HAFailover.cs.

◆ Logger

ILogger kinetica.HAFailoverManager.Logger = Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance
getset

Optional logger (category “Kinetica.HAFailover”).

Defaults to no-op when unset.

Definition at line 243 of file HAFailover.cs.

◆ NumClusterSwitches

int kinetica.HAFailoverManager.NumClusterSwitches
get

Gets the number of times the client has switched to a different cluster.

Definition at line 278 of file HAFailover.cs.


The documentation for this class was generated from the following files:
  • _build/public-os_centos8-arch_amd64-cc_gcc_8.5.0/install/Kinetica/Utils/HAFailover.cs
  • Kinetica/Utils/HAFailover.cs