2 using System.Collections.Generic;
9 public System.Uri
url {
get;
private set; }
10 private readonly
int capacity;
11 private readonly
bool has_primary_key;
12 private readonly
bool update_on_existing_pk;
13 private List<T> queue;
14 private Dictionary<RecordKey, int> primary_key_map;
38 public WorkerQueue(System.Uri
url,
int capacity,
bool has_primary_key,
bool update_on_existing_pk)
41 this.capacity = capacity;
55 IList<T> old_queue = this.queue;
56 queue =
new List<T>(this.capacity);
74 if (queue.Count == capacity)
A key based on a given record that serves as either a primary key or a shard key.
WorkerQueue(System.Uri url)
Creates an insertion queue for a given worker.
WorkerQueue(System.Uri url, int capacity, bool has_primary_key, bool update_on_existing_pk)
Creates an insertion queue for a given worker.
IList< T > flush()
Returns the current queue and creates a new empty one.
IList< T >? insert(T record, RecordKey key)
Inserts a record into the queue (if all conditions are favourable).