public void WriteCounter(CounterDetail counterDetail) { if (First == false) { Writer.WriteComma(); } First = false; Writer.WriteStartObject(); Writer.WritePropertyName(nameof(DocumentItem.CounterItem.DocId)); Writer.WriteString(counterDetail.DocumentId); Writer.WriteComma(); Writer.WritePropertyName(nameof(DocumentItem.CounterItem.Name)); Writer.WriteString(counterDetail.CounterName); Writer.WriteComma(); Writer.WritePropertyName(nameof(DocumentItem.CounterItem.Value)); Writer.WriteInteger(counterDetail.TotalValue); Writer.WriteComma(); Writer.WritePropertyName(nameof(DocumentItem.CounterItem.ChangeVector)); Writer.WriteString(counterDetail.ChangeVector); Writer.WriteEndObject(); }
public RavenEtlItem(CounterDetail counter, string collection) { DocumentId = counter.LazyDocumentId; Etag = counter.Etag; Collection = collection; ChangeVector = counter.ChangeVector; Type = EtlItemType.Counter; CounterName = counter.CounterName; CounterValue = counter.TotalValue; }
private void AddToBatch(CounterDetail counter) { var counterOp = new CounterOperation { Type = CounterOperationType.Put, CounterName = counter.CounterName, Delta = counter.TotalValue, ChangeVector = counter.ChangeVector }; _cmd.Add(counter.DocumentId, counterOp); _batchSize++; }
private void AddToBatch(CounterDetail counter) { var counterOp = new CounterOperation { Type = CounterOperationType.Put, CounterName = counter.CounterName, Delta = counter.TotalValue, ChangeVector = counter.ChangeVector }; var countersCount = _cmd.Add(counter.DocumentId, counterOp, out var isNew); if (isNew) { _docCount++; } if (countersCount > _countersPerDoc) { _countersPerDoc = countersCount; } }
public void WriteCounter(CounterDetail counterDetail) { AddToBatch(counterDetail); HandleBatchOfCountersIfNecessary(); }
public void WriteLegacyCounter(CounterDetail counterDetail) { // Used only in Database Destination throw new NotSupportedException("WriteLegacyCounter is not supported when writing to a Stream destination, " + "it is only supported when writing to Database destination. Shouldn't happen."); }