Skip to main content

Object that permits efficient retrieval of records from GPUdb using GenericRecord and dictionary-based records, with support for multi-head access and HA failover. More…

Public Member Functions

 GenericRecordRetriever (Kinetica kdb, string tableName, KineticaType ktype, WorkerList? workers=null)
 Create a GenericRecordRetriever for the given table.
 
ExecuteSqlResponse GetRecordsByKey (IDictionary< string, object?> keyValues, string? expression=null, IList< string >? columns=null, long offset=0, long limit=-9999)
 Retrieves records for a given shard key using SQL with fast index lookup.
 
ExecuteSqlResponse GetRecordsByExpression (string whereExpression, IList< string >? columns=null, long offset=0, long limit=-9999)
 Retrieves records using a SQL WHERE clause expression with fast index lookup optimization.
 
bool HasAllShardKeyValues (IDictionary< string, object?> keyValues)
 Checks if the given key values contain all required shard key columns.
 
int GetWorkerIndexForKey (IDictionary< string, object?> keyValues)
 Computes the worker index that would handle records with the given key values.
 
 GenericRecordRetriever (Kinetica kdb, string tableName, KineticaType ktype, WorkerList? workers=null)
 Create a GenericRecordRetriever for the given table.
 
ExecuteSqlResponse GetRecordsByKey (IDictionary< string, object?> keyValues, string? expression=null, IList< string >? columns=null, long offset=0, long limit=-9999)
 Retrieves records for a given shard key using SQL with fast index lookup.
 
ExecuteSqlResponse GetRecordsByExpression (string whereExpression, IList< string >? columns=null, long offset=0, long limit=-9999)
 Retrieves records using a SQL WHERE clause expression with fast index lookup optimization.
 
bool HasAllShardKeyValues (IDictionary< string, object?> keyValues)
 Checks if the given key values contain all required shard key columns.
 
int GetWorkerIndexForKey (IDictionary< string, object?> keyValues)
 Computes the worker index that would handle records with the given key values.
 

Properties

Kinetica KineticaDB [get]
 Gets the Kinetica connection.
 
string TableName [get]
 Gets the table name.
 
KineticaType KType [get]
 Gets the KineticaType for the table.
 
int NumClusterSwitches [get]
 Gets the number of cluster switches due to HA failover.
 
int HARingSize [get]
 Gets the HA ring size.
 
bool MultiHeadEnabled [get]
 Gets whether multi-head retrieval is enabled.
 
IList< string > ShardKeyColumnNames [get]
 Gets the shard key column names, or empty if table is not sharded.
 

Detailed Description

Object that permits efficient retrieval of records from GPUdb using GenericRecord and dictionary-based records, with support for multi-head access and HA failover.

This is used by the ADO.NET driver for key lookup operations where we don’t have strongly-typed record classes. It uses SQL execution with optimized expression building based on shard keys.

GenericRecordRetriever instances are thread safe and may be used from any number of threads simultaneously.

Definition at line 14 of file GenericRecordRetriever.cs.

Constructor & Destructor Documentation

◆ GenericRecordRetriever() [1/2]

kinetica.Utils.GenericRecordRetriever.GenericRecordRetriever (Kineticakdb,
stringtableName,
KineticaTypektype,
WorkerList?workers = null )
inline

Create a GenericRecordRetriever for the given table.

Parameters
kdbThe Kinetica connection.
tableNameThe table name to retrieve from.
ktypeThe KineticaType for the table.
workersOptional worker list for multi-head retrieval.

Definition at line 91 of file GenericRecordRetriever.cs.

◆ GenericRecordRetriever() [2/2]

kinetica.Utils.GenericRecordRetriever.GenericRecordRetriever (Kineticakdb,
stringtableName,
KineticaTypektype,
WorkerList?workers = null )
inline

Create a GenericRecordRetriever for the given table.

Parameters
kdbThe Kinetica connection.
tableNameThe table name to retrieve from.
ktypeThe KineticaType for the table.
workersOptional worker list for multi-head retrieval.

Definition at line 91 of file GenericRecordRetriever.cs.

Member Function Documentation

◆ GetRecordsByExpression() [1/2]

ExecuteSqlResponse kinetica.Utils.GenericRecordRetriever.GetRecordsByExpression (stringwhereExpression,
IList< string >?columns = null,
longoffset = 0,
longlimit = -9999 )
inline

Retrieves records using a SQL WHERE clause expression with fast index lookup optimization.

Parameters
whereExpressionSQL WHERE clause expression.
columnsOptional list of columns to retrieve. Null means all columns.
offsetStarting record offset (default 0).
limitMaximum number of records to retrieve (default -9999 means no limit).
Returns
The ExecuteSqlResponse containing the results.

Definition at line 405 of file GenericRecordRetriever.cs.

◆ GetRecordsByExpression() [2/2]

ExecuteSqlResponse kinetica.Utils.GenericRecordRetriever.GetRecordsByExpression (stringwhereExpression,
IList< string >?columns = null,
longoffset = 0,
longlimit = -9999 )
inline

Retrieves records using a SQL WHERE clause expression with fast index lookup optimization.

Parameters
whereExpressionSQL WHERE clause expression.
columnsOptional list of columns to retrieve. Null means all columns.
offsetStarting record offset (default 0).
limitMaximum number of records to retrieve (default -9999 means no limit).
Returns
The ExecuteSqlResponse containing the results.

Definition at line 405 of file GenericRecordRetriever.cs.

◆ GetRecordsByKey() [1/2]

ExecuteSqlResponse kinetica.Utils.GenericRecordRetriever.GetRecordsByKey (IDictionary< string, object?>keyValues,
string?expression = null,
IList< string >?columns = null,
longoffset = 0,
longlimit = -9999 )
inline

Retrieves records for a given shard key using SQL with fast index lookup.

All records matching the key and satisfying the optional additional expression will be returned, up to the specified limit.

Parameters
keyValuesDictionary of column name -> value for the shard key columns.
expressionAn optional additional filter expression.
columnsOptional list of columns to retrieve. Null means all columns (SELECT *).
offsetStarting record offset (default 0).
limitMaximum number of records to retrieve (default -9999 means no limit).
Returns
The ExecuteSqlResponse containing the results.

Definition at line 333 of file GenericRecordRetriever.cs.

◆ GetRecordsByKey() [2/2]

ExecuteSqlResponse kinetica.Utils.GenericRecordRetriever.GetRecordsByKey (IDictionary< string, object?>keyValues,
string?expression = null,
IList< string >?columns = null,
longoffset = 0,
longlimit = -9999 )
inline

Retrieves records for a given shard key using SQL with fast index lookup.

All records matching the key and satisfying the optional additional expression will be returned, up to the specified limit.

Parameters
keyValuesDictionary of column name -> value for the shard key columns.
expressionAn optional additional filter expression.
columnsOptional list of columns to retrieve. Null means all columns (SELECT *).
offsetStarting record offset (default 0).
limitMaximum number of records to retrieve (default -9999 means no limit).
Returns
The ExecuteSqlResponse containing the results.

Definition at line 333 of file GenericRecordRetriever.cs.

◆ GetWorkerIndexForKey() [1/2]

int kinetica.Utils.GenericRecordRetriever.GetWorkerIndexForKey (IDictionary< string, object?>keyValues)
inline

Computes the worker index that would handle records with the given key values.

This is useful for understanding data distribution.

Parameters
keyValuesDictionary of column name -> value for the shard key columns.
Returns
The worker index (0-based), or -1 if routing is not possible.

Definition at line 447 of file GenericRecordRetriever.cs.

◆ GetWorkerIndexForKey() [2/2]

int kinetica.Utils.GenericRecordRetriever.GetWorkerIndexForKey (IDictionary< string, object?>keyValues)
inline

Computes the worker index that would handle records with the given key values.

This is useful for understanding data distribution.

Parameters
keyValuesDictionary of column name -> value for the shard key columns.
Returns
The worker index (0-based), or -1 if routing is not possible.

Definition at line 447 of file GenericRecordRetriever.cs.

◆ HasAllShardKeyValues() [1/2]

bool kinetica.Utils.GenericRecordRetriever.HasAllShardKeyValues (IDictionary< string, object?>keyValues)
inline

Checks if the given key values contain all required shard key columns.

Parameters
keyValuesDictionary of column name -> value.
Returns
True if all shard key columns are present.

Definition at line 427 of file GenericRecordRetriever.cs.

◆ HasAllShardKeyValues() [2/2]

bool kinetica.Utils.GenericRecordRetriever.HasAllShardKeyValues (IDictionary< string, object?>keyValues)
inline

Checks if the given key values contain all required shard key columns.

Parameters
keyValuesDictionary of column name -> value.
Returns
True if all shard key columns are present.

Definition at line 427 of file GenericRecordRetriever.cs.

Property Documentation

◆ HARingSize

int kinetica.Utils.GenericRecordRetriever.HARingSize
get

Gets the HA ring size.

Definition at line 68 of file GenericRecordRetriever.cs.

◆ KineticaDB

Kinetica kinetica.Utils.GenericRecordRetriever.KineticaDB
get

Gets the Kinetica connection.

Definition at line 48 of file GenericRecordRetriever.cs.

◆ KType

KineticaType kinetica.Utils.GenericRecordRetriever.KType
get

Gets the KineticaType for the table.

Definition at line 58 of file GenericRecordRetriever.cs.

◆ MultiHeadEnabled

bool kinetica.Utils.GenericRecordRetriever.MultiHeadEnabled
get

Gets whether multi-head retrieval is enabled.

Definition at line 73 of file GenericRecordRetriever.cs.

◆ NumClusterSwitches

int kinetica.Utils.GenericRecordRetriever.NumClusterSwitches
get

Gets the number of cluster switches due to HA failover.

Definition at line 63 of file GenericRecordRetriever.cs.

◆ ShardKeyColumnNames

IList< string > kinetica.Utils.GenericRecordRetriever.ShardKeyColumnNames
get

Gets the shard key column names, or empty if table is not sharded.

Definition at line 78 of file GenericRecordRetriever.cs.

◆ TableName

string kinetica.Utils.GenericRecordRetriever.TableName
get

Gets the table name.

Definition at line 53 of file GenericRecordRetriever.cs.


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