public StorageEnvironment(StorageEnvironmentOptions options, string debugJournalName) : this(options) { DebugJournal = new DebugJournal(debugJournalName, this); if (Writer != null) { Writer.Dispose(); } Writer = new TransactionMergingWriter(this, _cancellationTokenSource.Token, DebugJournal); }
public unsafe StorageEnvironment(StorageEnvironmentOptions options) { try { TemporaryPage = new TemporaryPage(); _options = options; _dataPager = options.DataPager; _freeSpaceHandling = new FreeSpaceHandling(this); _sliceComparer = NativeMethods.memcmp; _headerAccessor = new HeaderAccessor(this); var isNew = _headerAccessor.Initialize(); _scratchBufferPool = new ScratchBufferPool(this); _journal = new WriteAheadJournal(this); if (isNew) { CreateNewDatabase(); } else // existing db, let us load it { LoadExistingDatabase(); } State.FreeSpaceRoot.Name = Constants.FreeSpaceTreeName; State.Root.Name = Constants.RootTreeName; Writer = new TransactionMergingWriter(this); if (_options.ManualFlushing == false) { _flushingTask = FlushWritesToDataFileAsync(); } } catch (Exception) { Dispose(); throw; } }
public StorageEnvironment(StorageEnvironmentOptions options) { try { _options = options; _dataPager = options.DataPager; _freeSpaceHandling = new FreeSpaceHandling(); _headerAccessor = new HeaderAccessor(this); var isNew = _headerAccessor.Initialize(); _scratchBufferPool = new ScratchBufferPool(this); _journal = new WriteAheadJournal(this); if (isNew) { CreateNewDatabase(); } else // existing db, let us load it { LoadExistingDatabase(); } Writer = new TransactionMergingWriter(this, _cancellationTokenSource.Token); if (_options.ManualFlushing == false) { _flushingTask = FlushWritesToDataFileAsync(); } } catch (Exception) { Dispose(); throw; } }