|
Kinetica C# API
Version 7.2.3.1
|
High-performance bulk inserter for Kinetica with support for multi-head ingest, More...
Inherits IAsyncDisposable, and IDisposable.
Public Member Functions | |
| BulkInserter (Kinetica kinetica, string tableName, KineticaType ktype, BulkInserterOptions? options=null) | |
| Creates a new BulkInserter for the specified table. More... | |
| BackpressureMetrics | GetBackpressureMetrics () |
| Gets backpressure metrics. More... | |
| void | Insert (T record) |
| Inserts a single record. More... | |
| async ValueTask | InsertAsync (T record, CancellationToken cancellationToken=default) |
| Inserts a single record with async backpressure control. More... | |
| void | InsertBatch (IReadOnlyList< T > records) |
| Inserts multiple records with parallel routing computation. More... | |
| async ValueTask | InsertBatchAsync (IReadOnlyList< T > records, CancellationToken cancellationToken=default) |
| Inserts multiple records with async backpressure control. More... | |
| void | Flush () |
| Flushes all queued records to Kinetica. More... | |
| async Task | FlushAsync (CancellationToken cancellationToken=default) |
| Flushes all queued records to Kinetica asynchronously. More... | |
| List< InsertError > | DrainErrors () |
| Drains and returns all errors from the error queue. More... | |
| IReadOnlyList< InsertError > | PeekErrors () |
| Peeks at errors without removing them. More... | |
| void | Close () |
| Flushes all records and waits for all pending batches to complete. More... | |
| async Task | CloseAsync (CancellationToken cancellationToken=default) |
| Flushes all records and waits for all pending batches to complete. More... | |
| void | Dispose () |
| Disposes the BulkInserter, closing it if not already closed. More... | |
| async ValueTask | DisposeAsync () |
| Disposes the BulkInserter asynchronously. More... | |
Public Attributes | |
| long | CountInserted => Interlocked.Read(ref _countInserted) |
| Gets the total count of records inserted. More... | |
| long | CountUpdated => Interlocked.Read(ref _countUpdated) |
| Gets the total count of records updated. More... | |
| long | PendingBatches => Interlocked.Read(ref _pendingBatches) |
| Gets the number of batches currently pending (queued or in-flight). More... | |
| long | TotalBatchesSent => Interlocked.Read(ref _totalBatchesSent) |
| Gets the total number of batches sent. More... | |
| long | TotalBatchesFailed => Interlocked.Read(ref _totalBatchesFailed) |
| Gets the total number of batches that failed. More... | |
| string | TableName => _tableName |
| Gets the table name. More... | |
| int | NumWorkers => _numWorkers |
| Gets the number of workers. More... | |
| int | ErrorCount => _errorCount |
| Gets the number of errors in the error queue. More... | |
| bool | IsTimedFlushRunning => _timedFlushRunning |
| Gets whether timed flush is currently running. More... | |
| int | NumClusterSwitches => _numClusterSwitches |
| Gets the number of times the cluster has been switched due to failover. More... | |
| int | HARingSize => _dbHaRingSize |
| Gets the HA ring size (number of clusters). More... | |
High-performance bulk inserter for Kinetica with support for multi-head ingest,
parallel processing, backpressure control, and async flush workers.
This implementation follows the Rust BulkInserter architecture with:
Types must implement IShardKeyExtractor for shard-aware routing.
| T | The record type to insert. Must implement IShardKeyExtractor. |
| T | : | Records.IShardKeyExtractor |
Definition at line 28 of file BulkInserter.cs.
|
inline |
Creates a new BulkInserter for the specified table.
| kinetica | The Kinetica connection. |
| tableName | The target table name. |
| ktype | The KineticaType for the table. |
| options | Optional configuration options. |
Definition at line 104 of file BulkInserter.cs.
|
inline |
Flushes all records and waits for all pending batches to complete.
Definition at line 1129 of file BulkInserter.cs.
|
inline |
Flushes all records and waits for all pending batches to complete.
This method will wait indefinitely for all batches to be sent to prevent data loss.
| cancellationToken | Cancellation token. |
Definition at line 1139 of file BulkInserter.cs.
|
inline |
Disposes the BulkInserter, closing it if not already closed.
Definition at line 1205 of file BulkInserter.cs.
|
inline |
Disposes the BulkInserter asynchronously.
Definition at line 1213 of file BulkInserter.cs.
|
inline |
Drains and returns all errors from the error queue.
Definition at line 875 of file BulkInserter.cs.
|
inline |
Flushes all queued records to Kinetica.
Definition at line 580 of file BulkInserter.cs.
|
inline |
Flushes all queued records to Kinetica asynchronously.
| cancellationToken | Cancellation token. |
Definition at line 589 of file BulkInserter.cs.
|
inline |
Gets backpressure metrics.
Definition at line 317 of file BulkInserter.cs.
|
inline |
Inserts a single record.
Non-blocking unless backpressure is applied.
| record | The record to insert. |
Definition at line 340 of file BulkInserter.cs.
|
inline |
Inserts a single record with async backpressure control.
Waits if the maximum number of in-flight batches is reached.
| record | The record to insert. |
| cancellationToken | Cancellation token. |
Definition at line 361 of file BulkInserter.cs.
|
inline |
Inserts multiple records with parallel routing computation.
This is the most efficient method for bulk inserts.
| records | The records to insert. |
Definition at line 383 of file BulkInserter.cs.
|
inline |
Inserts multiple records with async backpressure control.
| records | The records to insert. |
| cancellationToken | Cancellation token. |
Definition at line 450 of file BulkInserter.cs.
|
inline |
Peeks at errors without removing them.
Definition at line 889 of file BulkInserter.cs.
| long BulkInserter< T >.CountInserted => Interlocked.Read(ref _countInserted) |
Gets the total count of records inserted.
Definition at line 272 of file BulkInserter.cs.
| long BulkInserter< T >.CountUpdated => Interlocked.Read(ref _countUpdated) |
Gets the total count of records updated.
Definition at line 277 of file BulkInserter.cs.
| int BulkInserter< T >.ErrorCount => _errorCount |
Gets the number of errors in the error queue.
Definition at line 307 of file BulkInserter.cs.
| int BulkInserter< T >.HARingSize => _dbHaRingSize |
Gets the HA ring size (number of clusters).
Definition at line 906 of file BulkInserter.cs.
| bool BulkInserter< T >.IsTimedFlushRunning => _timedFlushRunning |
Gets whether timed flush is currently running.
Definition at line 312 of file BulkInserter.cs.
| int BulkInserter< T >.NumClusterSwitches => _numClusterSwitches |
Gets the number of times the cluster has been switched due to failover.
Definition at line 901 of file BulkInserter.cs.
| int BulkInserter< T >.NumWorkers => _numWorkers |
Gets the number of workers.
Definition at line 302 of file BulkInserter.cs.
| long BulkInserter< T >.PendingBatches => Interlocked.Read(ref _pendingBatches) |
Gets the number of batches currently pending (queued or in-flight).
Definition at line 282 of file BulkInserter.cs.
| string BulkInserter< T >.TableName => _tableName |
Gets the table name.
Definition at line 297 of file BulkInserter.cs.
| long BulkInserter< T >.TotalBatchesFailed => Interlocked.Read(ref _totalBatchesFailed) |
Gets the total number of batches that failed.
Definition at line 292 of file BulkInserter.cs.
| long BulkInserter< T >.TotalBatchesSent => Interlocked.Read(ref _totalBatchesSent) |
Gets the total number of batches sent.
Definition at line 287 of file BulkInserter.cs.