Beispiel #1
0
 public RavenEtlItem(Tombstone tombstone, string collection, EtlItemType type) : base(tombstone, collection, type)
 {
     if (tombstone.Type == Tombstone.TombstoneType.Attachment)
     {
         AttachmentTombstoneId = tombstone.LowerId;
     }
 }
Beispiel #2
0
        protected ExtractedItem(Tombstone tombstone, string collection, EtlItemType type)
        {
            Etag = tombstone.Etag;

            switch (type)
            {
            case EtlItemType.Document:
                Debug.Assert(tombstone.Type == Tombstone.TombstoneType.Document || tombstone.Type == Tombstone.TombstoneType.Attachment);
                DocumentId = tombstone.LowerId;
                Collection = collection;
                break;

            case EtlItemType.Counter:
                Debug.Assert(tombstone.Type == Tombstone.TombstoneType.Counter);
                Collection         = tombstone.Collection;
                CounterTombstoneId = tombstone.LowerId;
                break;
            }

            IsDelete     = true;
            ChangeVector = tombstone.ChangeVector;
            Type         = type;

            if (Collection == null)
            {
                CollectionFromMetadata = tombstone.Collection;
            }
        }
Beispiel #3
0
        public void RecordLastTransformedEtag(long etag, EtlItemType type)
        {
            Debug.Assert(type != EtlItemType.None);

            var current = _stats.LastTransformedEtags[type];

            if (etag > current)
            {
                _stats.LastTransformedEtags[type] = etag;
            }
        }
Beispiel #4
0
 public void RecordTransformedItem(EtlItemType itemType, bool isTombstone)
 {
     if (isTombstone)
     {
         _stats.NumberOfTransformedTombstones[itemType]++;
     }
     else
     {
         _stats.NumberOfTransformedItems[itemType]++;
     }
 }
Beispiel #5
0
        protected ExtractedItem(Document document, string collection, EtlItemType type)
        {
            DocumentId   = document.Id;
            Etag         = document.Etag;
            Document     = document;
            Collection   = collection;
            ChangeVector = document.ChangeVector;
            Type         = type;

            if (collection == null && type == EtlItemType.Document &&
                document.Data.TryGet(Constants.Documents.Metadata.Key, out BlittableJsonReaderObject metadata) &&
                metadata.TryGet(Constants.Documents.Metadata.Collection, out LazyStringValue docCollection))
            {
                CollectionFromMetadata = docCollection;
            }
        }
Beispiel #6
0
 protected override IEnumerator <RavenEtlItem> ConvertTombstonesEnumerator(IEnumerator <Tombstone> tombstones, string collection, EtlItemType type)
 {
     return(new TombstonesToRavenEtlItems(tombstones, collection, type));
 }
Beispiel #7
0
 public TombstonesToRavenEtlItems(IEnumerator <Tombstone> tombstones, string collection, EtlItemType tombstoneType)
 {
     _tombstones    = tombstones;
     _collection    = collection;
     _tombstoneType = tombstoneType;
 }
Beispiel #8
0
 public void RecordExtractedItem(EtlItemType itemType)
 {
     _stats.NumberOfExtractedItems[itemType]++;
 }
Beispiel #9
0
 public long GetLastTransformedOrFilteredEtag(EtlItemType type)
 {
     return(Math.Max(LastTransformedEtags[type], LastFilteredOutEtags[type]));
 }
Beispiel #10
0
 public ExtractedItemsEnumerator(EtlStatsScope stats, EtlItemType itemType)
 {
     _itemType        = itemType;
     _extractionStats = stats.For(EtlOperations.Extract, start: false);
 }
Beispiel #11
0
 public void RecordTransformedItem(EtlItemType itemType)
 {
     _stats.NumberOfTransformedItems[itemType]++;
 }