2 using System.Collections.Generic;
5 namespace kinetica.Utils
7 internal sealed
class WorkerQueue<T>
9 public System.Uri url {
get;
private set; }
11 private bool has_primary_key;
12 private bool update_on_existing_pk;
13 private IList<T> queue;
14 private Dictionary<RecordKey, int> primary_key_map;
21 public WorkerQueue( System.Uri url )
26 queue =
new List<T>();
38 public WorkerQueue(System.Uri url,
int capacity,
bool has_primary_key,
bool update_on_existing_pk)
41 this.capacity = capacity;
43 queue =
new List<T>();
53 public IList<T> flush()
55 IList<T> old_queue = this.queue;
56 queue =
new List<T>(this.capacity);
70 public IList<T> insert(T record, RecordKey key)
74 if (queue.Count == capacity)