public void Modify(ModifyHeaderAction modifyAction) { _locker.EnterWriteLock(); try { if (_theHeader == null) { throw new ObjectDisposedException("Cannot access the header after it was disposed"); } modifyAction(_theHeader); _revision++; _theHeader->HeaderRevision = _revision; var file = HeaderFileNames[_revision & 1]; _env.Options.WriteHeader(file, _theHeader); } finally { _locker.ExitWriteLock(); } }
public WriteAheadJournal(StorageEnvironment env) { _env = env; _dataPager = _env.Options.DataPager; _currentJournalFileSize = env.Options.InitialLogFileSize; _headerAccessor = env.HeaderAccessor; _updateLogInfo = header => { var journalFilesCount = _files.Count; header->Journal.CurrentJournal = journalFilesCount > 0 ? _journalIndex : -1; header->Journal.JournalFilesCount = journalFilesCount; header->IncrementalBackup.LastCreatedJournal = _journalIndex; }; _compressionPager = _env.Options.CreateScratchPager("compression.buffers"); _journalApplicator = new JournalApplicator(this); }
public void Modify(ModifyHeaderAction modifyAction) { _locker.EnterWriteLock(); try { modifyAction(_theHeader); _revision++; _theHeader->HeaderRevision = _revision; var file = HeaderFileNames[_revision & 1]; _env.Options.WriteHeader(file, _theHeader); } finally { _locker.ExitWriteLock(); } }