Skip to main content

Manages the insertion into GPUdb of large numbers of records in bulk, with automatic batch management and support for multi-head ingest. More…

Classes

class  InsertException
 The exception thrown when a batch of records fails to insert. More…
 

Public Member Functions

 InsertException (string msg)
 Initializes a new insert exception with the given message.
 
override string ToString ()
 
 KineticaIngestor (Kinetica kdb, string tableName, int batchSize, KineticaType ktype, Dictionary< string, string >? options=null, Utils.WorkerList? workers=null)
 Creates a new ingestor for bulk insertion of records into the specified table.
 
Int64 getCountInserted ()
 Returns the count of records inserted so far.
 
Int64 getCountUpdated ()
 Returns the count of records updated so far.
 
void flush ()
 Ensures that all queued records are inserted into Kinetica.
 
void insert (T record)
 Queues a record for insertion into Kinetica.
 
void insert (IList< T > records)
 Queues a list of records for insertion into Kinetica.
 
 InsertException (string msg)
 Initializes a new insert exception with the given message.
 
override string ToString ()
 
 KineticaIngestor (Kinetica kdb, string tableName, int batchSize, KineticaType ktype, Dictionary< string, string >? options=null, Utils.WorkerList? workers=null)
 Creates a new ingestor for bulk insertion of records into the specified table.
 
Int64 getCountInserted ()
 Returns the count of records inserted so far.
 
Int64 getCountUpdated ()
 Returns the count of records updated so far.
 
void flush ()
 Ensures that all queued records are inserted into Kinetica.
 
void insert (T record)
 Queues a record for insertion into Kinetica.
 
void insert (IList< T > records)
 Queues a list of records for insertion into Kinetica.
 

Public Attributes

Int64 count_inserted
 The running count of records inserted so far.
 
Int64 count_updated
 The running count of records that updated existing records (on primary-key collision).
 

Properties

Uri url [get]
 The worker URL the failed batch was being sent to, if known.
 
IList< T > records [get]
 The records that were not successfully inserted.
 
Kinetica kineticaDB [get]
 The Kinetica client used to insert records.
 
string table_name [get]
 The name of the table records are inserted into.
 
int batch_size [get]
 The number of records buffered before a batch is flushed to the server.
 
IDictionary< string, string > options [get]
 The insert options applied to each batch.
 

Detailed Description

Manages the insertion into GPUdb of large numbers of records in bulk, with automatic batch management and support for multi-head ingest.

Use the insert(T) and insert(IList<T>) methods to queue records for insertion, and the flush method to ensure that all queued records have been inserted.

Template Parameters
TThe type of object being inserted.

This class is obsolete. Use BulkInserter<T> instead, which provides better performance and async support among other features.

Definition at line 16 of file KineticaIngestor.cs.

Member Function Documentation

◆ flush() [1/2]

void kinetica.KineticaIngestor< T >.flush ()
inline

Ensures that all queued records are inserted into Kinetica.

If an error occurs while inserting the records from any queue, the records will no longer be in that queue nor in Kinetica; catch InsertException to get the list of records that were being inserted if needed (for example, to retry). Other queues may also still contain unflushed records if this occurs.

Exceptions
InsertExceptionIf the flushed records fail to insert

Definition at line 218 of file KineticaIngestor.cs.

◆ flush() [2/2]

void kinetica.KineticaIngestor< T >.flush ()
inline

Ensures that all queued records are inserted into Kinetica.

If an error occurs while inserting the records from any queue, the records will no longer be in that queue nor in Kinetica; catch InsertException to get the list of records that were being inserted if needed (for example, to retry). Other queues may also still contain unflushed records if this occurs.

Exceptions
InsertExceptionIf the flushed records fail to insert

Definition at line 218 of file KineticaIngestor.cs.

◆ getCountInserted() [1/2]

Int64 kinetica.KineticaIngestor< T >.getCountInserted ()
inline

Returns the count of records inserted so far.

An atomic operation.

Returns
The number of records inserted into Kinetica through this ingestor so far.

Definition at line 191 of file KineticaIngestor.cs.

◆ getCountInserted() [2/2]

Int64 kinetica.KineticaIngestor< T >.getCountInserted ()
inline

Returns the count of records inserted so far.

An atomic operation.

Returns
The number of records inserted into Kinetica through this ingestor so far.

Definition at line 191 of file KineticaIngestor.cs.

◆ getCountUpdated() [1/2]

Int64 kinetica.KineticaIngestor< T >.getCountUpdated ()
inline

Returns the count of records updated so far.

An atomic operation.

Returns
The number of records updated into Kinetica through this ingestor so far.

Definition at line 202 of file KineticaIngestor.cs.

◆ getCountUpdated() [2/2]

Int64 kinetica.KineticaIngestor< T >.getCountUpdated ()
inline

Returns the count of records updated so far.

An atomic operation.

Returns
The number of records updated into Kinetica through this ingestor so far.

Definition at line 202 of file KineticaIngestor.cs.

◆ insert() [1/4]

void kinetica.KineticaIngestor< T >.insert (IList< T >records)
inline

Queues a list of records for insertion into Kinetica.

If any queue reaches the configured batch size, all records in that queue will be inserted into Kinetica before the method returns. If an error occurs while inserting the queued records, the records will no longer be in that queue nor in Kinetica; catch InsertException to get the list of records that were being inserted (including any from the queue in question and any remaining in the list not yet queued) if needed (for example, to retry). Note that depending on the number of records, multiple calls to Kinetica may occur.

Parameters
recordsThe records to insert.
Exceptions
InsertExceptionIf the records cannot be inserted

Definition at line 343 of file KineticaIngestor.cs.

◆ insert() [2/4]

void kinetica.KineticaIngestor< T >.insert (IList< T >records)
inline

Queues a list of records for insertion into Kinetica.

If any queue reaches the configured batch size, all records in that queue will be inserted into Kinetica before the method returns. If an error occurs while inserting the queued records, the records will no longer be in that queue nor in Kinetica; catch InsertException to get the list of records that were being inserted (including any from the queue in question and any remaining in the list not yet queued) if needed (for example, to retry). Note that depending on the number of records, multiple calls to Kinetica may occur.

Parameters
recordsThe records to insert.
Exceptions
InsertExceptionIf the records cannot be inserted

Definition at line 343 of file KineticaIngestor.cs.

◆ insert() [3/4]

void kinetica.KineticaIngestor< T >.insert (Trecord)
inline

Queues a record for insertion into Kinetica.

If the queue reaches the configured batch size, all records in the queue will be inserted into Kinetica before the method returns. If an error occurs while inserting the records, the records will no longer be in the queue nor in Kinetica; catch InsertException to get the list of records that were being inserted if needed (for example, to retry).

Parameters
recordThe record to insert.
Exceptions
InsertExceptionIf the record cannot be inserted

Definition at line 285 of file KineticaIngestor.cs.

◆ insert() [4/4]

void kinetica.KineticaIngestor< T >.insert (Trecord)
inline

Queues a record for insertion into Kinetica.

If the queue reaches the configured batch size, all records in the queue will be inserted into Kinetica before the method returns. If an error occurs while inserting the records, the records will no longer be in the queue nor in Kinetica; catch InsertException to get the list of records that were being inserted if needed (for example, to retry).

Parameters
recordThe record to insert.
Exceptions
InsertExceptionIf the record cannot be inserted

Definition at line 285 of file KineticaIngestor.cs.

◆ InsertException() [1/2]

kinetica.KineticaIngestor< T >.InsertException (stringmsg)
inline

Initializes a new insert exception with the given message.

Parameters
msgThe error message.

Definition at line 29 of file KineticaIngestor.cs.

◆ InsertException() [2/2]

kinetica.KineticaIngestor< T >.InsertException (stringmsg)
inline

Initializes a new insert exception with the given message.

Parameters
msgThe error message.

Definition at line 29 of file KineticaIngestor.cs.

◆ KineticaIngestor() [1/2]

kinetica.KineticaIngestor< T >.KineticaIngestor (Kineticakdb,
stringtableName,
intbatchSize,
KineticaTypektype,
Dictionary< string, string >?options = null,
Utils.WorkerList?workers = null )
inline

Creates a new ingestor for bulk insertion of records into the specified table.

This class is obsolete; use BulkInserter<T> instead for better performance, async support, and feature parity with the Rust API.

Parameters
kdbKinetica client connection.
tableNameName of the target table to insert into.
batchSizeNumber of records to queue per worker before flushing to the server.
ktypeType definition of the records being inserted.
optionsOptional ingest options; recognized keys are defined as constants on InsertRecordsRequest<T>.Options.
workersOptional explicit list of worker URLs. If null, the worker list is fetched from the server.

Definition at line 81 of file KineticaIngestor.cs.

◆ KineticaIngestor() [2/2]

kinetica.KineticaIngestor< T >.KineticaIngestor (Kineticakdb,
stringtableName,
intbatchSize,
KineticaTypektype,
Dictionary< string, string >?options = null,
Utils.WorkerList?workers = null )
inline

Creates a new ingestor for bulk insertion of records into the specified table.

This class is obsolete; use BulkInserter<T> instead for better performance, async support, and feature parity with the Rust API.

Parameters
kdbKinetica client connection.
tableNameName of the target table to insert into.
batchSizeNumber of records to queue per worker before flushing to the server.
ktypeType definition of the records being inserted.
optionsOptional ingest options; recognized keys are defined as constants on InsertRecordsRequest<T>.Options.
workersOptional explicit list of worker URLs. If null, the worker list is fetched from the server.

Definition at line 81 of file KineticaIngestor.cs.

◆ ToString() [1/2]

override string kinetica.KineticaIngestor< T >.ToString ()
inline

Definition at line 38 of file KineticaIngestor.cs.

◆ ToString() [2/2]

override string kinetica.KineticaIngestor< T >.ToString ()
inline

Definition at line 38 of file KineticaIngestor.cs.

Member Data Documentation

◆ count_inserted

Int64 kinetica.KineticaIngestor< T >.count_inserted

The running count of records inserted so far.

Definition at line 56 of file KineticaIngestor.cs.

◆ count_updated

Int64 kinetica.KineticaIngestor< T >.count_updated

The running count of records that updated existing records (on primary-key collision).

Definition at line 58 of file KineticaIngestor.cs.

Property Documentation

◆ batch_size

int kinetica.KineticaIngestor< T >.batch_size
get

The number of records buffered before a batch is flushed to the server.

Definition at line 51 of file KineticaIngestor.cs.

◆ kineticaDB

Kinetica kinetica.KineticaIngestor< T >.kineticaDB
get

The Kinetica client used to insert records.

Definition at line 47 of file KineticaIngestor.cs.

◆ options

IDictionary<string, string> kinetica.KineticaIngestor< T >.options
get

The insert options applied to each batch.

Definition at line 53 of file KineticaIngestor.cs.

◆ records

IList<T> kinetica.KineticaIngestor< T >.records
get

The records that were not successfully inserted.

Definition at line 25 of file KineticaIngestor.cs.

◆ table_name

string kinetica.KineticaIngestor< T >.table_name
get

The name of the table records are inserted into.

Definition at line 49 of file KineticaIngestor.cs.

◆ url

Uri kinetica.KineticaIngestor< T >.url
get

The worker URL the failed batch was being sent to, if known.

Definition at line 23 of file KineticaIngestor.cs.


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