Kinetica   C#   API  Version 7.2.3.1
BulkInserterOptions.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 
4 namespace kinetica;
5 
9  public sealed class BulkInserterOptions
10  {
15  public int BatchSize { get; set; } = 10_000;
16 
22  public int MaxInFlightBatches { get; set; } = 100;
23 
28  public int NumStripes { get; set; } = Environment.ProcessorCount;
29 
34  public int MaxFlushWorkers { get; set; } = Math.Max(4, Environment.ProcessorCount * 2);
35 
40  public int MaxRetries { get; set; } = 3;
41 
47  public int FlushIntervalSeconds { get; set; } = 0;
48 
53  public Dictionary<string, string> InsertOptions { get; set; } = new();
54 
58  public IBatchInsertionListener? BatchListener { get; set; }
59 
63  public Utils.WorkerList? WorkerList { get; set; }
64 
69  public int MaxErrorQueueSize { get; set; } = 10_000;
70 
75  public int CloseTimeoutMs { get; set; } = 60_000;
76 
80  public BulkInserterOptions() { }
81 
85  public BulkInserterOptions(int batchSize)
86  {
87  BatchSize = batchSize;
88  }
89 
94  {
95  return new BulkInserterOptions
96  {
103  InsertOptions = new Dictionary<string, string>(InsertOptions),
108  };
109  }
110  }
int NumStripes
Number of stripes per worker queue to reduce lock contention.
int BatchSize
Number of records per batch before triggering a flush.
int MaxErrorQueueSize
Maximum number of errors to queue before discarding.
A list of worker URLs to use for multi-head operations.
Definition: WorkerList.cs:20
BulkInserterOptions Clone()
Creates a copy of these options.
BulkInserterOptions()
Creates options with default values.
Utils.? WorkerList WorkerList
Optional worker list override.
BulkInserterOptions(int batchSize)
Creates options with specified batch size.
Dictionary< string, string > InsertOptions
Options to pass to the insert_records API.
IBatchInsertionListener? BatchListener
Optional batch insertion listener for callbacks on batch completion.
int FlushIntervalSeconds
Interval in seconds between automatic flushes.
int MaxInFlightBatches
Maximum number of batches that can be in-flight at once.
int MaxFlushWorkers
Maximum number of concurrent flush workers.
int CloseTimeoutMs
Timeout for close operations in milliseconds.
Configuration options for the BulkInserter<T>.
int MaxRetries
Maximum number of retry attempts for failed inserts.
Listener interface for batch insertion events.