Exemplo n.º 1
0
 public DocumentSmuggler(DatabaseSmugglerOptions options, DatabaseSmugglerNotifications notifications, IDatabaseSmugglerSource source, IDatabaseSmugglerDestination destination, DatabaseLastEtagsInfo maxEtags)
     : base(options, notifications, source, destination)
 {
     _maxEtags = maxEtags;
     _patcher  = new SmugglerJintHelper();
     _patcher.Initialize(options);
 }
        public Task <DatabaseLastEtagsInfo> FetchCurrentMaxEtagsAsync(CancellationToken cancellationToken)
        {
            DatabaseLastEtagsInfo result = null;

            _database.TransactionalStorage.Batch(accessor =>
            {
                result = new DatabaseLastEtagsInfo
                {
                    LastDocsEtag = accessor.Staleness.GetMostRecentDocumentEtag()
                };

                var lastDocumentTombstone = accessor.Lists.ReadLast(Constants.RavenPeriodicExportsDocsTombstones);
                if (lastDocumentTombstone != null)
                {
                    result.LastDocDeleteEtag = lastDocumentTombstone.Etag;
                }
            });

            return(new CompletedTask <DatabaseLastEtagsInfo>(result));
        }
Exemplo n.º 3
0
 public DocumentDeletionsSmuggler(DatabaseSmugglerOptions options, DatabaseSmugglerNotifications notifications, IDatabaseSmugglerSource source, IDatabaseSmugglerDestination destination, DatabaseLastEtagsInfo maxEtags)
     : base(options, notifications, source, destination)
 {
     _maxEtags = maxEtags;
 }