Esempio n. 1
0
        public WriteAheadJournal(StorageEnvironment env)
        {
            _env       = env;
            _dataPager = _env.Options.DataPager;
            _currentJournalFileSize = env.Options.InitialLogFileSize;
            _headerAccessor         = env.HeaderAccessor;
            _updateLogInfo          = header =>
            {
                var journalFilesCount = _files.Count;
                var currentJournal    = journalFilesCount > 0 ? _journalIndex : -1;
                header->Journal.CurrentJournal               = currentJournal;
                header->Journal.JournalFilesCount            = journalFilesCount;
                header->IncrementalBackup.LastCreatedJournal = _journalIndex;
            };

            _shipppedTransactionsApplicator = new ShipppedTransactionsApplicator(_env, 0, _env.NextWriteTransactionId - 1);

            _compressionPager  = _env.Options.CreateScratchPager("compression.buffers");
            _journalApplicator = new JournalApplicator(this);
        }
Esempio n. 2
0
		public WriteAheadJournal(StorageEnvironment env)
		{
			_env = env;
			_dataPager = _env.Options.DataPager;
			_currentJournalFileSize = env.Options.InitialLogFileSize;
			_headerAccessor = env.HeaderAccessor;
			_updateLogInfo = header =>
			{
				var journalFilesCount = _files.Count;
				var currentJournal = journalFilesCount > 0 ? _journalIndex : -1;
				header->Journal.CurrentJournal = currentJournal;
				header->Journal.JournalFilesCount = journalFilesCount;
				header->IncrementalBackup.LastCreatedJournal = _journalIndex;
			};

			_shipppedTransactionsApplicator = new ShipppedTransactionsApplicator(_env, 0, _env.NextWriteTransactionId - 1);

			_compressionPager = _env.Options.CreateScratchPager("compression.buffers");
			_journalApplicator = new JournalApplicator(this);
		}