public void AddDocument(T document, bool clearDocumentRefs = true) { if (document == null) { throw new Exception("Document is null"); } var doc = GetDocument(document, clearDocumentRefs); int temporyCount = 0; DocumentPartition partition; if (doc.Exists) { partition = new DocumentPartition(doc.Partition, doc.Exists); } else { if (IsPartialStore) { temporyCount = Queue.Count(d => d.PartOf.Partition == Meta.Partitions.Current); partition = Meta.GetPartition(Meta.Partitions.Current, PartialStoreLimit, temporyCount); } else { partition = new DocumentPartition(Meta.Partitions.Current, doc.Exists); } } Enqueue(doc, partition); }
private void Enqueue(Document document, DocumentPartition partOf) { document.Partition = partOf.Partition; var queue = new DocumentQueue(document, partOf); Queue.Enqueue(queue); if (Partitions.Count(p => p.Partition == partOf.Partition && p.Operation == partOf.Operation) == 0) { Partitions.Enqueue(partOf); } }
public IEnumerable <Block> GetAllBlocks() { return(DocumentPartition.GetAllBlocks() .Concat(SprocPartition.GetAllBlocks())); }
public DocumentQueue(Document document, DocumentPartition partOf) { Document = document; PartOf = partOf; }