Skip to main content

A list of worker URLs to use for multi-head operations. More…

Inherits IReadOnlyList, and IReadOnlyList.

Public Member Functions

 WorkerList ()
 Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head operations.
 
 WorkerList (Kinetica db)
 Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.
 
 WorkerList (Kinetica db, Regex? ip_regex)
 Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.
 
void Add (Uri url)
 Adds a URL to the worker list.
 
void AddOrNull (Uri? url)
 Adds a URL or null (for removed rank) to the worker list.
 
void Clear ()
 Clears all URLs from the worker list.
 
IEnumerable< Uri > GetActiveUrls ()
 Gets all active (non-null) URLs in the worker list.
 
List< string > ToUrlStrings ()
 Converts the worker list to a list of URL strings.
 
Uri? Get (int index)
 Gets the URL at the specified index, or null if the rank was removed or index is out of bounds.
 
IEnumerator< Uri?> GetEnumerator ()
 Returns an enumerator that iterates through the worker URLs.
 
IEnumerable< Uri > GetActiveUrlsEnumerator ()
 Returns an enumerator that iterates through only active (non-null) worker URLs.
 
 WorkerList ()
 Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head operations.
 
 WorkerList (Kinetica db)
 Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.
 
 WorkerList (Kinetica db, Regex? ip_regex)
 Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.
 
void Add (Uri url)
 Adds a URL to the worker list.
 
void AddOrNull (Uri? url)
 Adds a URL or null (for removed rank) to the worker list.
 
void Clear ()
 Clears all URLs from the worker list.
 
IEnumerable< Uri > GetActiveUrls ()
 Gets all active (non-null) URLs in the worker list.
 
List< string > ToUrlStrings ()
 Converts the worker list to a list of URL strings.
 
Uri? Get (int index)
 Gets the URL at the specified index, or null if the rank was removed or index is out of bounds.
 
IEnumerator< Uri?> GetEnumerator ()
 Returns an enumerator that iterates through the worker URLs.
 
IEnumerable< Uri > GetActiveUrlsEnumerator ()
 Returns an enumerator that iterates through only active (non-null) worker URLs.
 

Static Public Member Functions

static WorkerList FromUrls (IEnumerable< Uri > urls)
 Creates a WorkerList from explicit URLs.
 
static WorkerList WithIpPrefix (Kinetica db, string? ip_prefix)
 Creates a WorkerList and automatically populates it with the worker URLs from Kinetica, filtering by IP prefix.
 
static WorkerList FromUrls (IEnumerable< Uri > urls)
 Creates a WorkerList from explicit URLs.
 
static WorkerList WithIpPrefix (Kinetica db, string? ip_prefix)
 Creates a WorkerList and automatically populates it with the worker URLs from Kinetica, filtering by IP prefix.
 

Properties

bool IsMultiHeadEnabled [get]
 Whether multi-head I/O is enabled on the server.
 
Regex? IpRegex [get]
 The IP regex used to filter worker URLs, if one was specified.
 
bool IsQueriedUrlList [get]
 Whether this worker list was created by querying the server.
 
int Count [get]
 Gets the number of workers in the list (including removed ranks).
 
Uri? this[int index] [get]
 Gets the URL at the specified index.
 
bool IsEmpty [get]
 Returns whether the worker list is empty.
 
int ActiveCount [get]
 Gets the number of active (non-null) workers in the list.
 

Detailed Description

A list of worker URLs to use for multi-head operations.

This class contains the URLs of worker nodes in a Kinetica cluster for direct multi-head ingest/retrieval operations. Worker URLs are stored in rank order, starting with rank 1, and all worker ranks must be included; otherwise operations may fail for certain data types.

Note: Some ranks may be “removed” (represented as null entries). Use GetActiveUrls or iterate with null checks when processing workers.

Definition at line 17 of file WorkerList.cs.

Constructor & Destructor Documentation

◆ WorkerList() [1/6]

kinetica.Utils.WorkerList.WorkerList ()
inline

Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head operations.

Note that worker URLs must be added in rank order, starting with rank 1, and all worker ranks must be included; otherwise operations may fail for certain data types.

Definition at line 55 of file WorkerList.cs.

◆ WorkerList() [2/6]

kinetica.Utils.WorkerList.WorkerList (Kineticadb)
inline

Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.

If the specified Kinetica instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.

Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; this constructor uses the first IP returned by the server for each worker. To override this behavior, use the overload with an IP regex parameter.

Parameters
dbThe Kinetica instance from which to obtain the worker URLs.

Definition at line 77 of file WorkerList.cs.

◆ WorkerList() [3/6]

kinetica.Utils.WorkerList.WorkerList (Kineticadb,
Regex?ip_regex )
inline

Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.

If the specified Kinetica instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.

Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; the optional ip_regex parameter can be used in such cases to filter for an IP range that is accessible, e.g., a regex of 192.168..* will use worker IP addresses in the 192.168.* range.

Parameters
dbThe Kinetica instance from which to obtain the worker URLs.
ip_regexOptional IP regex to match.

Definition at line 97 of file WorkerList.cs.

◆ WorkerList() [4/6]

kinetica.Utils.WorkerList.WorkerList ()
inline

Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head operations.

Note that worker URLs must be added in rank order, starting with rank 1, and all worker ranks must be included; otherwise operations may fail for certain data types.

Definition at line 55 of file WorkerList.cs.

◆ WorkerList() [5/6]

kinetica.Utils.WorkerList.WorkerList (Kineticadb)
inline

Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.

If the specified Kinetica instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.

Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; this constructor uses the first IP returned by the server for each worker. To override this behavior, use the overload with an IP regex parameter.

Parameters
dbThe Kinetica instance from which to obtain the worker URLs.

Definition at line 77 of file WorkerList.cs.

◆ WorkerList() [6/6]

kinetica.Utils.WorkerList.WorkerList (Kineticadb,
Regex?ip_regex )
inline

Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations.

If the specified Kinetica instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.

Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; the optional ip_regex parameter can be used in such cases to filter for an IP range that is accessible, e.g., a regex of 192.168..* will use worker IP addresses in the 192.168.* range.

Parameters
dbThe Kinetica instance from which to obtain the worker URLs.
ip_regexOptional IP regex to match.

Definition at line 97 of file WorkerList.cs.

Member Function Documentation

◆ Add() [1/2]

void kinetica.Utils.WorkerList.Add (Uriurl)
inline

Adds a URL to the worker list.

Parameters
urlThe URL to add.

Definition at line 325 of file WorkerList.cs.

◆ Add() [2/2]

void kinetica.Utils.WorkerList.Add (Uriurl)
inline

Adds a URL to the worker list.

Parameters
urlThe URL to add.

Definition at line 325 of file WorkerList.cs.

◆ AddOrNull() [1/2]

void kinetica.Utils.WorkerList.AddOrNull (Uri?url)
inline

Adds a URL or null (for removed rank) to the worker list.

Parameters
urlThe URL to add, or null for a removed rank.

Definition at line 334 of file WorkerList.cs.

◆ AddOrNull() [2/2]

void kinetica.Utils.WorkerList.AddOrNull (Uri?url)
inline

Adds a URL or null (for removed rank) to the worker list.

Parameters
urlThe URL to add, or null for a removed rank.

Definition at line 334 of file WorkerList.cs.

◆ Clear() [1/2]

void kinetica.Utils.WorkerList.Clear ()
inline

Clears all URLs from the worker list.

Definition at line 342 of file WorkerList.cs.

◆ Clear() [2/2]

void kinetica.Utils.WorkerList.Clear ()
inline

Clears all URLs from the worker list.

Definition at line 342 of file WorkerList.cs.

◆ FromUrls() [1/2]

static WorkerList kinetica.Utils.WorkerList.FromUrls (IEnumerable< Uri >urls)
inlinestatic

Creates a WorkerList from explicit URLs.

Parameters
urlsList of URLs to use for worker ranks.
Returns
A new WorkerList containing the specified URLs.

Definition at line 152 of file WorkerList.cs.

◆ FromUrls() [2/2]

static WorkerList kinetica.Utils.WorkerList.FromUrls (IEnumerable< Uri >urls)
inlinestatic

Creates a WorkerList from explicit URLs.

Parameters
urlsList of URLs to use for worker ranks.
Returns
A new WorkerList containing the specified URLs.

Definition at line 152 of file WorkerList.cs.

◆ Get() [1/2]

Uri? kinetica.Utils.WorkerList.Get (intindex)
inline

Gets the URL at the specified index, or null if the rank was removed or index is out of bounds.

Parameters
indexThe index of the worker URL to get (0-based, corresponds to rank-1).
Returns
The URL at the specified index, or null.

Definition at line 387 of file WorkerList.cs.

◆ Get() [2/2]

Uri? kinetica.Utils.WorkerList.Get (intindex)
inline

Gets the URL at the specified index, or null if the rank was removed or index is out of bounds.

Parameters
indexThe index of the worker URL to get (0-based, corresponds to rank-1).
Returns
The URL at the specified index, or null.

Definition at line 387 of file WorkerList.cs.

◆ GetActiveUrls() [1/2]

IEnumerable< Uri > kinetica.Utils.WorkerList.GetActiveUrls ()
inline

Gets all active (non-null) URLs in the worker list.

Returns
An enumerable of active worker URLs.

Definition at line 358 of file WorkerList.cs.

◆ GetActiveUrls() [2/2]

IEnumerable< Uri > kinetica.Utils.WorkerList.GetActiveUrls ()
inline

Gets all active (non-null) URLs in the worker list.

Returns
An enumerable of active worker URLs.

Definition at line 358 of file WorkerList.cs.

◆ GetActiveUrlsEnumerator() [1/2]

IEnumerable< Uri > kinetica.Utils.WorkerList.GetActiveUrlsEnumerator ()
inline

Returns an enumerator that iterates through only active (non-null) worker URLs.

This provides backward compatibility with code that expects to iterate over a List<Uri>.

Definition at line 415 of file WorkerList.cs.

◆ GetActiveUrlsEnumerator() [2/2]

IEnumerable< Uri > kinetica.Utils.WorkerList.GetActiveUrlsEnumerator ()
inline

Returns an enumerator that iterates through only active (non-null) worker URLs.

This provides backward compatibility with code that expects to iterate over a List<Uri>.

Definition at line 415 of file WorkerList.cs.

◆ GetEnumerator() [1/2]

IEnumerator< Uri?> kinetica.Utils.WorkerList.GetEnumerator ()
inline

Returns an enumerator that iterates through the worker URLs.

Note: May include null entries for removed ranks.

Definition at line 398 of file WorkerList.cs.

◆ GetEnumerator() [2/2]

IEnumerator< Uri?> kinetica.Utils.WorkerList.GetEnumerator ()
inline

Returns an enumerator that iterates through the worker URLs.

Note: May include null entries for removed ranks.

Definition at line 398 of file WorkerList.cs.

◆ ToUrlStrings() [1/2]

List< string > kinetica.Utils.WorkerList.ToUrlStrings ()
inline

Converts the worker list to a list of URL strings.

Only includes active (non-null) URLs.

Returns
A list of URL strings for all active workers.

Definition at line 373 of file WorkerList.cs.

◆ ToUrlStrings() [2/2]

List< string > kinetica.Utils.WorkerList.ToUrlStrings ()
inline

Converts the worker list to a list of URL strings.

Only includes active (non-null) URLs.

Returns
A list of URL strings for all active workers.

Definition at line 373 of file WorkerList.cs.

◆ WithIpPrefix() [1/2]

static WorkerList kinetica.Utils.WorkerList.WithIpPrefix (Kineticadb,
string?ip_prefix )
inlinestatic

Creates a WorkerList and automatically populates it with the worker URLs from Kinetica, filtering by IP prefix.

The ip_prefix parameter can be used to filter for an IP range that is accessible, e.g., a prefix of 192.168. will use worker IP addresses in the 192.168.* range.

Parameters
dbThe Kinetica instance from which to obtain the worker URLs.
ip_prefixIP prefix to match (e.g., “192.168.”).
Returns
A new WorkerList containing matching worker URLs.

Definition at line 174 of file WorkerList.cs.

◆ WithIpPrefix() [2/2]

static WorkerList kinetica.Utils.WorkerList.WithIpPrefix (Kineticadb,
string?ip_prefix )
inlinestatic

Creates a WorkerList and automatically populates it with the worker URLs from Kinetica, filtering by IP prefix.

The ip_prefix parameter can be used to filter for an IP range that is accessible, e.g., a prefix of 192.168. will use worker IP addresses in the 192.168.* range.

Parameters
dbThe Kinetica instance from which to obtain the worker URLs.
ip_prefixIP prefix to match (e.g., “192.168.”).
Returns
A new WorkerList containing matching worker URLs.

Definition at line 174 of file WorkerList.cs.

Property Documentation

◆ ActiveCount

int kinetica.Utils.WorkerList.ActiveCount
get

Gets the number of active (non-null) workers in the list.

Definition at line 366 of file WorkerList.cs.

◆ Count

int kinetica.Utils.WorkerList.Count
get

Gets the number of workers in the list (including removed ranks).

Definition at line 39 of file WorkerList.cs.

◆ IpRegex

Regex kinetica.Utils.WorkerList.IpRegex
get

The IP regex used to filter worker URLs, if one was specified.

Definition at line 29 of file WorkerList.cs.

◆ IsEmpty

bool kinetica.Utils.WorkerList.IsEmpty
get

Returns whether the worker list is empty.

Definition at line 352 of file WorkerList.cs.

◆ IsMultiHeadEnabled

bool kinetica.Utils.WorkerList.IsMultiHeadEnabled
get

Whether multi-head I/O is enabled on the server.

Definition at line 24 of file WorkerList.cs.

◆ IsQueriedUrlList

bool kinetica.Utils.WorkerList.IsQueriedUrlList
get

Whether this worker list was created by querying the server.

Definition at line 34 of file WorkerList.cs.

◆ this[int index]

Uri? kinetica.Utils.WorkerList.this[int index]
get

Gets the URL at the specified index.

Returns null if the rank was removed or index is out of bounds.

Definition at line 45 of file WorkerList.cs.


The documentation for this class was generated from the following files: