public static ReplicationBatchItem From(DocumentTombstone doc) { var item = new ReplicationBatchItem { Etag = doc.Etag, Id = doc.LowerId, TransactionMarker = doc.TransactionMarker, ChangeVector = doc.ChangeVector }; switch (doc.Type) { case DocumentTombstone.TombstoneType.Document: item.Type = ReplicationItemType.DocumentTombstone; item.Collection = doc.Collection; item.Flags = doc.Flags; item.LastModifiedTicks = doc.LastModified.Ticks; break; case DocumentTombstone.TombstoneType.Attachment: item.Type = ReplicationItemType.AttachmentTombstone; break; case DocumentTombstone.TombstoneType.Revision: item.Type = ReplicationItemType.RevisionTombstone; item.Collection = doc.Collection; break; default: throw new ArgumentOutOfRangeException(nameof(doc.Type)); } return(item); }
public void WriteTombstone(DocumentTombstone tombstone, SmugglerProgressBase.CountsWithLastEtag progress) { _command.Add(new DocumentItem { Tombstone = tombstone }); HandleBatchOfDocumentsIfNecessary(); }
public unsafe void HandleDelete(DocumentTombstone tombstone, string collection, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) { var tx = indexContext.Transaction.InnerTransaction; var loweredKey = tombstone.LowerId; using (Slice.External(tx.Allocator, loweredKey.Buffer, loweredKey.Size, out Slice tombstoneKeySlice)) _indexStorage.RemoveReferences(tombstoneKeySlice, collection, null, indexContext.Transaction); }
protected ExtractedItem(DocumentTombstone tombstone, string collection) { Etag = tombstone.Etag; DocumentId = tombstone.LowerId; IsDelete = true; Collection = collection; ChangeVector = tombstone.ChangeVector; }
public override void HandleDelete(DocumentTombstone tombstone, string collection, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) { if (_referencedCollections.Count > 0) { _handleReferences.HandleDelete(tombstone, collection, writer, indexContext, stats); } base.HandleDelete(tombstone, collection, writer, indexContext, stats); }
public RavenEtlItem(DocumentTombstone tombstone, string collection) : base(tombstone, collection) { if (collection != null) { return; } CollectionFromMetadata = tombstone.Collection; }
protected ExtractedItem(DocumentTombstone tombstone, string collection) { Etag = tombstone.Etag; DocumentId = tombstone.LowerId; IsDelete = true; Collection = collection; ChangeVector = tombstone.ChangeVector; if (collection == null) { CollectionFromMetadata = tombstone.Collection; } }
public void WriteTombstone(DocumentTombstone tombstone, SmugglerProgressBase.CountsWithLastEtag progress) { if (First == false) { Writer.WriteComma(); } First = false; _context.Write(Writer, new DynamicJsonValue { ["Key"] = tombstone.LowerId, [nameof(DocumentTombstone.Type)] = tombstone.Type.ToString(), [nameof(DocumentTombstone.Collection)] = tombstone.Collection, [nameof(DocumentTombstone.Flags)] = tombstone.Flags.ToString(), [nameof(DocumentTombstone.ChangeVector)] = tombstone.ChangeVector, [nameof(DocumentTombstone.DeletedEtag)] = tombstone.DeletedEtag, [nameof(DocumentTombstone.Etag)] = tombstone.Etag, [nameof(DocumentTombstone.LastModified)] = tombstone.LastModified, }); }
public override unsafe void HandleDelete(DocumentTombstone tombstone, string collection, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) { using (Slice.External(indexContext.Allocator, tombstone.LowerId.Buffer, tombstone.LowerId.Length, out Slice docKeyAsSlice)) { MapReduceWorkContext.DocumentMapEntries.RepurposeInstance(docKeyAsSlice, clone: false); if (MapReduceWorkContext.DocumentMapEntries.NumberOfEntries == 0) { return; } foreach (var mapEntry in GetMapEntries(MapReduceWorkContext.DocumentMapEntries)) { var store = GetResultsStore(mapEntry.ReduceKeyHash, indexContext, create: false); store.Delete(mapEntry.Id); } MapReduceWorkContext.MapPhaseTree.DeleteFixedTreeFor(tombstone.LowerId, sizeof(ulong)); } }
public override void HandleDelete(DocumentTombstone tombstone, string collection, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) { throw new NotSupportedException($"Index {Name} is in-memory implementation of a faulty index", _e); }
public ToSqlItem(DocumentTombstone tombstone, string collection) : base(tombstone, collection) { }
public RavenEtlItem(DocumentTombstone tombstone, string collection) : base(tombstone, collection) { }
public override void HandleDelete(DocumentTombstone tombstone, string collection, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) { writer.Delete(tombstone.LoweredKey, stats); }
public override void HandleDelete(DocumentTombstone tombstone, string collection, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) { throw new NotImplementedException(); }