|
Kinetica C# API
Version 7.2.3.1
|
A worker queue with multiple stripes to reduce lock contention. More...
Public Member Functions | |
| StripedWorkerQueue (Uri url, int workerIndex, int numStripes, int batchSize) | |
| Creates a new striped worker queue. More... | |
| List< T >? | Add (T record, long stripeHash, out int stripeIndex) |
| Adds a record to the appropriate stripe based on the stripe hash. More... | |
| List< T >? | AddToStripe (T record, int stripeIndex) |
| Adds a record to a specific stripe. More... | |
| List< List< T > > | AddRangeToStripe (IReadOnlyList< T > records, int stripeIndex) |
| Adds multiple records to a specific stripe. More... | |
| List<(int stripeIndex, List< T > batch)> | FlushAll () |
| Flushes all stripes and returns all batches. More... | |
Public Attributes | |
| int | NumStripes => _numStripes |
| Number of stripes in this queue. More... | |
Properties | |
| Uri | Url [get] |
| URL of the worker this queue is associated with. More... | |
| int | WorkerIndex [get] |
| Index of this worker in the worker list. More... | |
| int | TotalCount [get] |
| Gets the total count of records across all stripes. More... | |
A worker queue with multiple stripes to reduce lock contention.
Each stripe operates independently, allowing concurrent inserts to different stripes.
| T | The record type. |
Definition at line 98 of file StripedWorkerQueue.cs.
|
inline |
Creates a new striped worker queue.
| url | Worker URL. |
| workerIndex | Worker index. |
| numStripes | Number of stripes (should be power of 2 for efficient modulo). |
| batchSize | Batch size per stripe. |
Definition at line 121 of file StripedWorkerQueue.cs.
|
inline |
Adds a record to the appropriate stripe based on the stripe hash.
Returns a batch if the stripe reaches capacity.
| record | The record to add. |
| stripeHash | Hash value to determine stripe placement. |
| stripeIndex | Output: the stripe index used. |
Definition at line 157 of file StripedWorkerQueue.cs.
|
inline |
Adds multiple records to a specific stripe.
Definition at line 174 of file StripedWorkerQueue.cs.
|
inline |
Adds a record to a specific stripe.
Definition at line 166 of file StripedWorkerQueue.cs.
|
inline |
Flushes all stripes and returns all batches.
Definition at line 183 of file StripedWorkerQueue.cs.
| int StripedWorkerQueue< T >.NumStripes => _numStripes |
Number of stripes in this queue.
Definition at line 216 of file StripedWorkerQueue.cs.
|
get |
Gets the total count of records across all stripes.
Definition at line 201 of file StripedWorkerQueue.cs.
|
get |
URL of the worker this queue is associated with.
Definition at line 107 of file StripedWorkerQueue.cs.
|
get |
Index of this worker in the worker list.
Definition at line 112 of file StripedWorkerQueue.cs.