Example #1
0
            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();
            }
Example #2
0
 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;
 }
Example #3
0
            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++;
            }
Example #4
0
            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;
                }
            }
Example #5
0
 public void WriteCounter(CounterDetail counterDetail)
 {
     AddToBatch(counterDetail);
     HandleBatchOfCountersIfNecessary();
 }
Example #6
0
 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.");
 }