public byte[] this[byte[] key] { get { return(Db.Get(key)); } set { UpdateWriteMetrics(); if (CurrentBatch != null) { if (value == null) { CurrentBatch.Delete(key); } else { CurrentBatch.Put(key, value); } } else { if (value == null) { Db.Remove(key, null, WriteOptions); } else { Db.Put(key, value, null, WriteOptions); } } } }
public void AddDocumentToBatch(Document document) { if (CurrentBatch == null) { CurrentBatch = new DocumentBatch(document.Number, document.Prefix); } CurrentBatch.Add(document); }
private async Task SendCurrentBatch() { if (CurrentBatch.IsEmpty) { return; } var numberToSend = CurrentBatch.Count; await SendBatchAsync(CurrentBatch.ToArray()); Indexed += numberToSend; CurrentBatch.Clear(); }
public StimuliSet GetSet() { return(CurrentBatch.GetSet()); }