|
Kinetica C# API
Version 7.2.3.1
|
A list of worker URLs to use for multi-head operations. More...
Inherits IReadOnlyList< Uri?>.
Public Member Functions | |
| WorkerList () | |
| Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head operations. More... | |
| WorkerList? (Kinetica db) | |
| Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations. More... | |
| WorkerList (Kinetica db, Regex? ip_regex) | |
| Creates a WorkerList and automatically populates it with the worker URLs from Kinetica to support multi-head operations. More... | |
| void | Add (Uri url) |
| Adds a URL to the worker list. More... | |
| void | AddOrNull (Uri? url) |
| Adds a URL or null (for removed rank) to the worker list. More... | |
| void | Clear () |
| Clears all URLs from the worker list. More... | |
| IEnumerable< Uri > | GetActiveUrls () |
| Gets all active (non-null) URLs in the worker list. More... | |
| List< string > | ToUrlStrings () |
| Converts the worker list to a list of URL strings. More... | |
| Uri? | Get (int index) |
| Gets the URL at the specified index, or null if the rank was removed or index is out of bounds. More... | |
| IEnumerator< Uri?> | GetEnumerator () |
| Returns an enumerator that iterates through the worker URLs. More... | |
| IEnumerable< Uri > | GetActiveUrlsEnumerator () |
| Returns an enumerator that iterates through only active (non-null) worker URLs. More... | |
Static Public Member Functions | |
| static WorkerList | FromUrls (IEnumerable< Uri > urls) |
| Creates a WorkerList from explicit URLs. More... | |
| 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. More... | |
Public Attributes | |
| int | Count => _urls.Count |
| Gets the number of workers in the list (including removed ranks). More... | |
| Uri? | this[int index] => index >= 0 && index < _urls.Count ? _urls[index] : null |
| Gets the URL at the specified index. More... | |
| bool | IsEmpty => _urls.Count == 0 |
| Returns whether the worker list is empty. More... | |
| int | ActiveCount => _urls.Count(u => u != null) |
| Gets the number of active (non-null) workers in the list. More... | |
Properties | |
| bool | IsMultiHeadEnabled [get] |
| Whether multi-head I/O is enabled on the server. More... | |
| Regex? | IpRegex [get] |
| The IP regex used to filter worker URLs, if one was specified. More... | |
| bool | IsQueriedUrlList [get] |
| Whether this worker list was created by querying the server. More... | |
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 20 of file WorkerList.cs.
|
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 58 of file WorkerList.cs.
|
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.
| db | The Kinetica instance from which to obtain the worker URLs. |
| ip_regex | Optional IP regex to match. |
Definition at line 100 of file WorkerList.cs.
|
inline |
Adds a URL to the worker list.
| url | The URL to add. |
Definition at line 328 of file WorkerList.cs.
|
inline |
Adds a URL or null (for removed rank) to the worker list.
| url | The URL to add, or null for a removed rank. |
Definition at line 337 of file WorkerList.cs.
|
inline |
Clears all URLs from the worker list.
Definition at line 345 of file WorkerList.cs.
|
inlinestatic |
Creates a WorkerList from explicit URLs.
| urls | List of URLs to use for worker ranks. |
Definition at line 155 of file WorkerList.cs.
|
inline |
Gets the URL at the specified index, or null if the rank was removed or index is out of bounds.
| index | The index of the worker URL to get (0-based, corresponds to rank-1). |
Definition at line 390 of file WorkerList.cs.
|
inline |
Gets all active (non-null) URLs in the worker list.
Definition at line 361 of file WorkerList.cs.
|
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 418 of file WorkerList.cs.
|
inline |
Returns an enumerator that iterates through the worker URLs.
Note: May include null entries for removed ranks.
Definition at line 401 of file WorkerList.cs.
|
inline |
Converts the worker list to a list of URL strings.
Only includes active (non-null) URLs.
Definition at line 376 of file WorkerList.cs.
|
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.
| db | The Kinetica instance from which to obtain the worker URLs. |
| ip_prefix | IP prefix to match (e.g., "192.168."). |
Definition at line 177 of file WorkerList.cs.
|
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.
| db | The Kinetica instance from which to obtain the worker URLs. |
Definition at line 80 of file WorkerList.cs.
| int WorkerList.ActiveCount => _urls.Count(u => u != null) |
Gets the number of active (non-null) workers in the list.
Definition at line 369 of file WorkerList.cs.
| int WorkerList.Count => _urls.Count |
Gets the number of workers in the list (including removed ranks).
Definition at line 42 of file WorkerList.cs.
| bool WorkerList.IsEmpty => _urls.Count == 0 |
Returns whether the worker list is empty.
Definition at line 355 of file WorkerList.cs.
| Uri? WorkerList.this[int index] => index >= 0 && index < _urls.Count ? _urls[index] : null |
Gets the URL at the specified index.
Returns null if the rank was removed or index is out of bounds.
Definition at line 48 of file WorkerList.cs.
|
get |
The IP regex used to filter worker URLs, if one was specified.
Definition at line 32 of file WorkerList.cs.
|
get |
Whether multi-head I/O is enabled on the server.
Definition at line 27 of file WorkerList.cs.
|
get |
Whether this worker list was created by querying the server.
Definition at line 37 of file WorkerList.cs.