Exemplo n.º 1
0
        public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)
        {
            var         temp  = _metadata.GetChangeBatch(uint.MaxValue, destinationKnowledge);
            ChangeBatch batch = _metadata.GetChangeBatch(batchSize, destinationKnowledge);

            changeDataRetriever = this; //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient
            var batchCount = (uint)batch.Count();

            batch.BatchWorkEstimate            = batchCount;
            batch.RemainingSessionWorkEstimate = (uint)temp.Count();
            return(batch);
        }
        //Simply ask the metadata store to compute my change batch for me, providing the batch size and the knowledge of the other endpoint!
        //The engine is asking for the list of changes that the destination provider does not know about.
        public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)
        {
            ChangeBatch batch = _metadata.GetChangeBatch(batchSize, destinationKnowledge);

            changeDataRetriever = this; //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient
            return(batch);
        }
Exemplo n.º 3
0
        public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)
        {
            ChangeBatch batch = _metaData.GetChangeBatch(batchSize, destinationKnowledge);

            changeDataRetriever = this;             //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient

            //Calculate estimate work
            batch.RemainingSessionWorkEstimate = RemainingSessionWorkEstimate;
            batch.BatchWorkEstimate            = batch.IsLastBatch ? (uint)batch.Count() : batchSize;
            RemainingSessionWorkEstimate       = batch.IsLastBatch ? 0 : RemainingSessionWorkEstimate - batchSize;

            return(batch);
        }
Exemplo n.º 4
0
        //Simply ask the metadata store to compute my change batch for me, providing the batch size and the knowledge of the other endpoint!
        //The engine is asking for the list of changes that the destination provider does not know about.
        public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)
        {
            ChangeBatch batch = _metadata.GetChangeBatch(batchSize, destinationKnowledge);

            foreach (ItemChange change in batch)
            {
                Trace.WriteLine(change.ItemId + "" + change.ChangeKind);
            }
            changeDataRetriever = this; //this is where the transfer mechanism/protocol would go. For an in memory provider, this is sufficient
            uint changesCount = 0;

            foreach (ItemChange itemChange in batch)
            {
                changesCount++;
            }
            batch.RemainingSessionWorkEstimate = _syncItemCount;
            batch.BatchWorkEstimate            = batch.IsLastBatch ? changesCount : batchSize;
            _syncItemCount = batch.IsLastBatch ? 0 : _syncItemCount - batchSize;

            return(batch);
        }